WordPress.org

Support

Support » Plugins and Hacks » Hacks » Remove post tags from category rss

Remove post tags from category rss

  • WordPress automatically includes both tags and categories in the RSS category tag when outputting the RSS2 for the site. I’ve figured out how to remove tags by deleting the line that includes them in the /wp-includes/feed.php file on line 315, but whenever wordpress is updated, this is reverted back to including tags.

    How would you remove tags from the category RSS using the functions.php?

Viewing 5 replies - 1 through 5 (of 5 total)
  • As you have realised, modifying core code is never a good idea; and usually unnecessary.

    This is untried, but something like this should work..’

    add_filter('get_the_tags', 'strip_tags_from_feeds');
    function strip_tags_from_feeds($terms) {
        if (is_feed())
          return array();
        return $terms;
    }

    Any way I can get a functional example of this code? Unfortunately my PHP skills are still in need of improvement.

    Just tested it, and it will work exactly as I wrote.

    Add that code to functions.php in your theme and the tags will not be included in the RSS feeds.

    Thanks so much, been looking forever for this solution.

    Thanks Mike, I was looking for this too.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Remove post tags from category rss’ is closed to new replies.