How To Exclude Category In Wordpress Feed
Keep annoying posts out of your feeds for loyal readers.
Using this blog as an example, I’ll quickly show you how I prevent any post in a specific category from appearing in your Wordpress feed.
Knowing the ID of the category you don’t want to show - I remove my Twitter posts which are in category 31 - we append the exclusion code:
http://your-blog.com/index.php?feed=rss2&cat=-31
Note the original Wordpress feed structure. Even if you use ‘pretty permalinks’ for your feed - ie. *.com/feed - this will still work.
According to Nicole at Beyond Caffeine, if you want more than one category to be excluded you can keep adding the code:
http://your-blog.com/index.php?feed=rss2&cat=-18&cat=-22
However, a more traditional PHP structure may also work:1
http://your-blog.com/index.php?feed=rss2&cat=-18,-22
- If you use ‘pretty permalinks’ in Wordpress, this format still works. [↩]