Last week I wrote about how to disable WordPress RSS feed completely from end users. Sometimes there are cases where we want posts from certain categories not to publish in RSS feed; we just wish to unpublish post in feed.
There are 2 ways to disable categories in feeds.
1. If you’re a feedburner user
You’ll have to edit the original feed source in your feedburner account like below;
http://designgala.com/feed?cat=-7&cat=-18
Above URL would exclude posts from categories with ID 7 and 18
2. From standard RSS feed
In order to use this method, you need to add following code in function.php of your active theme.
/** * disable RSS feed */ function exclude_categories_in_feed($query) { if ($query->is_feed) { $query->set('cat','-7,-18'); return $query; } add_filter('pre_get_posts','exclude_categories_in_feed');
I hope this was short but cool wordpress hack to exclude categories from RSS feed.

beachy
June 26, 2010
Hi,
I tried to use the code for the standard RSS feed and got an error. I think you are missing a closing bracket. Where should it go?
Thank you!
mabahl
April 28, 2011
Doesn’t work for me.