We sometimes meet an original gentleman, who, if manners had not existed, would have invented them. ~Ralph Waldo Emmerson

Excluding Categories from RSS Feed

i wrote this on April 19th, 2007 at: 5:23 pm and its been viewed 2,257 views

On my E.Webscapes site - I have several different sections. The entire site is powered by the fabulous WordPress CMS, and yet, each of the different sections of my site have a different type of set up. I publish two different feeds at E.Webscapes. One is for my Design Blog and the other is just for my Design Portfolio feed. I handle posts to the blog and the portfolio in the same manner, the key is the category I assign each post to. The portfolio is assigned only to the “Design Portfolio” category - while posts to the design blog are assigned to varous different categories - except the “Design Portfolio” category. So, how do I seperate the Design Portfolio feeds from the regular blog posts? I mean, if I’m publishing a feed that includes all the posts to the blog - - and the Design Portfolio posts are included — how do I keep those posts out of my main feed?

To complicate matters, I also have a category I make posts to callled “Client Testimonials” — that is where I post all the testimonials that are left by our wonderful clients and are posted seperately from the blog here.

Keeping the Design Portfolio and Testimonial posts off my main blog is just a matter of some PHP code - but how to keep them out of the main feed, as well? I use Feedburner, for one thing. When you sign up for a Feedburner account, one of the first things you have to provide is the RSS Feed URL for the feed you want to publish.

On my site - the categories I need to exclude are:
‘Design Portfolio’ (which has the category ID of 19)
‘Client Testimonials’ (which has the category ID of 18)

So, when I provided my Feed URL to feedburner - here is what it looked like:

http://ewebscapes.com/feed?cat=-18&cat=-19

The last bit is what tells it to exclude categories from the feed - - and they are excluded by category ID: ?cat=-18&cat=-19

You can exclude any category from your main feed that you’d like, just by using that last statement that includes which category ID you would like to exclude. Of course, this works in any scenario, not just Feedburner. Most sites don’t have a need to exclude categories from their main RSS Feed - - but some do. I do - which is why I use it and thought I’d pass along that bit-o-knowledge.. hope it helps someone somewhere :) That’s all.

Disclaimer - I’ve verified this works with the WordPress 2.0 development track, as well as 2.2 and 2.3 - just an fyi






5 Responses to “Excluding Categories from RSS Feed”

Trackbacks & Pingbacks
  1. » Pingback by Daily Cup of Tech » Creating Custom WordPress Feeds

  2. » Pingback by Paul Johns / Asides are now on this site, and in my soul.

  1. 1
    Alan Says:

    Hi Lisa,

    This post helped solve a small problem quickly and simply.

    Thank you. Keep up the good work!

    Best regards,
    Alan

  2. 2
    Lisa Says:

    Alan, I’m glad you found it helpful. Thanks for stopping by!

  3. 3
    Karl Says:

    Thanks for this great post. I started a new category, but I didn’t want it sent out in my feed. Feedburner forums were no help. But I found this post and it worked perfectly. Thank you so much. Awesome work.

    (» Read Pensacola Real Estate News’s last blog post..Pensacola Real Estate News - 6467 Mitzi Lane)

This site uses Gravatars - get one to display your own picture!

Join My Community at MyBloglog!
Add to Technorati Favorites
Lisa Sabin-Wilson's Amazon.com WishList
View Lisa Sabin's profile on LinkedIn
Find Lisa Sabin-Wilson on Twitter
Lisa Sabin Wilsons Blog Feed
Li-sa Sa-bin Wil-son: [lee-suh sey-bin will-sun] - pronoun; 1. A wife, mother & friend; 2. Blog Designer & WebHost; 3. Author of WordPress For Dummies; 4. Scuba diver; 5. Downhill Skier; 6. Am. Photographer; 7. Espresso sipper; 8. quote collector
WordPress For Dummies, author Lisa Sabin-Wilson, Amazon.Com WordPress For Dummies, by Lisa Sabin-Wilson, delivers just what would-be bloggers need to get up and running with WordPress and start communicating with the world. Includes help on every aspect of installing and using WordPress, illustrations from real-world WP blogs, step-by-step tutorials on key topics, and insights from bloggers who use WordPress.....Read More About It »

Acknowledgements | Forward | Table of Contents | Chapter One
Buy @ Amazon | Buy @ Barnes and Noble

  • This is just a test post. Testing from my new smartphone. Will check when I get home. In the meantime....happy April!

    - #
  • Look for an update to the WordPress For Dummies book that will include what's new and exciting in the newest version of WordPress 2.5. This will be available in a free, downloadable PDF document both here, on my site, as well as Dummies.com. Will keep you posted!

    - #
  • Charles Stricklin hosts the popular WordPress podcast over at http://wp-community.org. I was interviewed for this weeks episode, which you can listen to right here. Thanks, Charles, for being a great host!

    - #
  • Wanna peak at the new design for the WordPress Administration Panel coming soon when version 2.5 is released in March?? I posted a review of it here - have a looksee, tell me what'cha think!

    - #
  • Just put up a job posting looking for a part-time designer at E.Webscapes. Interested? Or know someone who might be? view details of the job post right here

    - #