[resolved] Removing specific images from RSS feed (2 posts)

  1. bahrt
    Posted 1 year ago #

    We are starting to work with a customer who's buying our RSS2 feed and we need to send them the full contents of each post. We also want to send them the images included on each post, but as they are going to reproduce them on their side too, there are images which need to be stripped from the feed to avoid copyright issues. One solution I came up with is removing them based on pattern matching (either file name or description would be enough), but I just don't know how to implement it in WordPress.
    This post looks like what I need to do but it's too old and I don't know where to find the equivalent in our version: http://wordpress.org/support/topic/removing-images-from-rss-feed

    Is this something that can be done? If so, how?


  2. bahrt
    Posted 1 year ago #

    After some digging, I found that what I'm looking for is in wp-includes/feed.php:
    $content = apply_filters('the_content', get_the_content());
    $content = str_replace(']]>', ']]>', $content);
    return apply_filters('the_content_feed', $content, $feed_type);

    but the correct way to do it is with an XML parser, so I'm closing this one.


Topic Closed

This topic has been closed to new replies.

About this Topic