How to Exclude Categories from RSS Feed in WordPress

wplogo-stacked-rgbLast 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;

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) {
return $query;

I hope this was short but cool wordpress hack to exclude categories from RSS feed.

7 replys to How to Exclude Categories from RSS Feed in WordPress

  1. Pingback: WordPress Rocker
  2. Pingback: Design Gala
  3. Pingback: Anish Lama
  4. Pingback: WordPress Rocker
  5. Pingback: WordPress Rocker
  6. 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!

Leave a Reply

Your email address will not be published. Required fields are marked *