What filters can I use to remove specific HTML elements with certain classes from the Wordpress feed? Not remove everything inside the element, mind you, but just remove the markup itself.
<div class="remove-this class1 class2 class3"> <img class="remove-this class4 class5 class6" /> <p>Yada yada bla bla whatever dummy text</p> <img class="class7" /> </div>
The result should be:
<p>Yada yada bla bla whatever dummy text</p> <img class="class7" />
Why? We have a syndication agreement with a big web portal. They will get articles from our feed and automatically put it in their CMS.
The problem is that I've used shortcodes to allow varied multi-column layouts, which won't work properly because the CSS I defined for the layouting is of course not available on the web portal. The shortcodes resolve into divs with specific classes attached to them.
The trick is of course removing the trailing elements for those that have opening and closing tags, without touching the content wrapped inside. Thus I'm not sure if Regex is the best (and most efficient) approach here.