elegant themes

How to exclude multiple categories from your WordPress feed

| January 23, 2011 | 3 Comments

I was searching desperately for a solution for creating a custom WordPress feed that excluded two categories that would be used to offer a unique Feedburner feed to readers. I found posts that explained how to exclude categories globally, but that wasn’t relevant since these categories still needed to be available to readers on the site. Other options explained how to add parameters to the URL to exclude the feeds, as follows (the numbers are the Category IDs):

  • http://mysite.com/feed?cat=-102&cat=-103
    OR
  • http://mysite.com/feed?cat=-102,-103

However, every time I plugged those URLs into my browser address bar to test them, the last category in the URL would disappear, and the feed would include that category.

I finally found this post by Kriesi: How to Modify Your WordPress RSS Feed. It gives the same instructions for creating the exclusionary feed as many other posts, but says the following which gave me an “aha” moment:

But beware, feedburner expects a slightly different syntax; insted of using ampersands you have to use commas.

This made me realize that feed readers might read feeds differently than a browser. So I opened Google Reader and plugged in my custom feed. It worked! I then plugged it into Feedburner, and it worked too!

Why do browsers chew up the feeds?

0saves
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Tags: , , , , ,

Category: Tips

About Miriam Schwab: Miriam is the friendly CEO of illuminea, a WordPress design and development agency. Miriam is a huge fan of WordPress and has been using it for over five years now. In addition, Miriam and her team have been organizing the local Israeli WordCamp conferences for the past few years. View author profile.

Elegant WP Themes

Comments (3)

Trackback URL | Comments RSS Feed

  1. priyanka says:

    this is not happining in rojkinews How can i do this in http://www.rojkinews.com

  2. Nathan says:

    Thanks a lot for this, it was exactly what I was looking for.
    Cheers!

Leave a Reply




If you want a picture to show with your comment, go get a Gravatar.

More in Tips (13 of 85 articles)