I’ve searched and found posts that have asked and answered how to merge different categories into an RSS feed. What I need to know is how to exclude specific categories from the RSS feed?
Specifically, I use WP to post blog articles and to post portfolio items onto my site. I want to exclude the portfolio category from appearing in the RSS feed, making only blog posts available.
It’s been broken since 3.1, see:
http://core.trac.wordpress.org/ticket/16622
and also
http://wordpress.org/support/topic/wp-31-breaks-rss-customization-via-exclude_category
NOTE: Otto’s suggested fix in that thread doesn’t work for me.
Ticket suggests patch will go in for 3.1.1 and i can confirm that currently filters on
pre_get_posts
orparse_query
fail for feeds(unfortunately).Not too confident to get hooks right from memory… I think hooking into
pre_get_posts
and settingcategory__not_in
to what you want to skip onis_feed()
conditional should work.But might require playing with different hooks earlier/later, querying internals are confusing around there.
Either of these snippets in your functions file will work using
pre_get_posts