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 need to remove the tag that appears on my feed content ($content variable).
http://mkt-d.hospedagemdesites.ws/wp/feed/
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?
Share Improve this question edited Jun 6, 2019 at 18:41 vts asked Jun 6, 2019 at 17:58 vtsvts 134 bronze badges1 Answer
Reset to default 3I 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');