Categorized | Articles, Tips, Tutorials, WordPress

WordPress How To – Exclude Categories from a Feed

One of the best aspects of WordPress is that it gives you remarkable control over your feeds, allowing you to pick and choose what you would like to display and in what way. Granted, that applies to WordPress in general, but it is infinitely useful for the feeds your system creates.

For instance, if I want to merely show one category in a feed, I would link to feed for that single category. A feed that would only show the reviews of the site is very simple to achive. You go the page main category page (in this example the category is ‘reviews’) and then you add a forward slash (/) and the word ‘feed’. Like this:

http://blog.websitestyle.com/index.php/category/reviews/feed/

However, if you wanted to exclude that category, then you would need to know the number of the category. That is simple enough to find. You would go to your ‘manage’ tab, then click on ‘categories’. Scan down your category list, and you’ll find the number of the category in the associated ‘ID’ column. So now, for the above example, my ‘reviews’ category has an ‘ID’ of 18.

Now each WordPress blog has a feed URL that will display ALL posts from the blog regardless of category. It looks like this: http://blog.websitestyle.com/index.php?feed=rss2

To exclude all posts in the ‘reviews’ category, you would instead using the following adjustment to your normal feed link:

http://blog.websitestyle.com/index.php?feed=rss2&cat=-18

And now you have a link to a feed that shows all my categories EXCEPT for those in the ‘reviews’ section.

Ah, but what if you want to exclude more than one category? What’s the syntax?

You simply add each one to exclude like this: http://blog.websitestyle.com/index.php?feed=rss2&cat=-18&cat=-22

The above would exclude both my ‘reviews’ and ‘templates’ categories. I actually use this when I embed my blog feed in another website that is purely tech (nothing personal included), and I exclude things I’ve categorized as non-tech related so they don’t show up.

Hope this was helpful to someone out there.

About The Author:

Nicole Hernandez is a web developer with a specialty in web standards and accessibility. She is the owner of Website Style and publishes technical articles on her blog called Beyond Caffeine.

If you enjoyed this post, make sure you subscribe to my RSS feed!

Related posts:

  1. Why WordPress is now my Blog of Choice
  2. Customize Your WordPress Dashboard
  3. WordPress Plugin – Feed Footer
  4. Fun With RSS in WordPress – Post For Your RSS Readers Only
  5. Insert RSS feed into your post with QuickRSS

3 Comments For This Post

  1. bagus Says:

    thanks, it helps me

  2. Zack Katz @ Katz Web Design Says:

    Thanks for the hint. I knew WordPress must have a simple way of doing this — lo and behold they do!

  3. Faggot59 Says:

    Germany can reach so much, if it binds the others more in, says Heusgen and dreams even about an axle Merkel – Zapatero. ,

1 Trackbacks For This Post

  1. Tying Your Tubes with WordPress - My Session at WordCamp Portland at Josh Bancroft’s TinyScreenfuls.com Says:

    [...] How to exclude a category (say, your tweet digest) from your site’s RSS feed. Either have people subscribe to the funky URL you get from this, or if you use FeedBurner, just tell it that the funky URL is your source feed. [...]

Leave a Reply

Categories

-->