I need to remove the tag that appears on my feed content ($content variable).


Is there an existing function to this task?

Some tags appear with width instructions that are differents on each appear. How can I remove them completely?


I believe the most direct way of customizing WordPress feeds is to hook into them directly with the following filter. Edit: as we talked about, let's just edit the content to tear out any

function edit_your_feed_content($content) {
    $content = preg_replace("/(<figure.*?[^>]*>)(.*?)(<\/figure>)/i", "", $content);
    return $content;
add_filter('the_content', 'edit_your_feed_content');
  • Hi, Chris. Thanks! Whats the syntax to remove every figure item?
    – vts
    Jun 6 '19 at 18:41
  • It will remove figure tag for all new posts or it will work on older posts too? Again, thanks!
    – vts
    Jun 6 '19 at 18:53
  • It should work on new and old. You are filtering the content that gets pushed back to your RSS Feed. Jun 6 '19 at 18:56
  • I added the function but it won't work. mkt-d.hospedagemdesites.ws/wp/feed figure items are still showing. Any suggestion? And thanks again. I'm really thankful you're giving attention to this post.
    – vts
    Jun 6 '19 at 18:58
  • I just updated the block above, give that a try! This time we are also going to filter the_content and see if that can't resolve it. Jun 6 '19 at 19:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.