Lisa Sabin-Wilson. Designer. Author. Espresso and WordPress addict

Excluding Categories from RSS Feed

on: Apr/19/07 and its been viewed 3,847 times

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

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • BlinkList
  • blogmarks
  • E-mail this story to a friend!
  • Fark
  • Furl
  • LinkedIn
  • Ma.gnolia
  • MySpace
  • Ping.fm
  • Reddit
  • Slashdot
  • SphereIt
  • StumbleUpon
  • TwitThis
  • Yahoo! Buzz

Posted on:April 19, 2007

Posted in: WordPress

Tags: , , , , ,

/*--- 7 Responses to “Excluding Categories from RSS Feed” ---*/

  1. Daily Cup of Tech » Creating Custom WordPress Feeds
    5:34 am on July 25th, 2007

    [...] Excluding Categories from RSS Feed [...]

  2. Paul Johns / Asides are now on this site, and in my soul.
    4:48 pm on August 26th, 2007

    [...] Excluding Categories from RSS Feed [...]

  3. Alan
    2:42 pm on September 7th, 2007

    Hi Lisa,

    This post helped solve a small problem quickly and simply.

    Thank you. Keep up the good work!

    Best regards,
    Alan

  4. Lisa
    1:47 pm on September 8th, 2007

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

  5. Karl
    8:23 pm on January 19th, 2008

    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)

  6. diana
    12:36 pm on July 1st, 2008

    Can you have it go in the reverse manner? That is to ONLY include certain category ID’s?

  7. Kolia Shlapak
    12:47 pm on July 21st, 2008

    for me it’s worked only with one excluded category

Leave a Reply

  • 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;
    contact me »
    WordPress For Dummies, author Lisa Sabin-Wilson, Amazon.ComWordPress For Dummies, 2nd Ed. was released February 17, 2009. It covers WordPress.com and WordPress.Org through version 2.7 and includes comprehensive information about tweaking your own WordPress theme, creating your own theme and the basics of what you need to know about basic HTML and CSS...read more »

    • Jenny: Congrats. :) Good luck with it.
    • Barn Notes: I’m off. I got my blueprints: WordPress for...
    • Thomas: Greetings: I truly feel your pain, as well as that of the...
    • George: Well,since I am not very fluent in english I am going to be...
    • Kristen: Well, I’m finally following up on my March 23rd...
    • New York Movers: Hey Lisa, Best Baklava in NYC is from The...
    • alan doyle: the average nest size is in direct relation too how...
    • Lisa: @Jeet – I am pretty sure Wiley has already confirmed an...
    • TiffanyB: This is GREAT!!!! I found this after I was searching if...
    • Jeet: @Lisa: Who will be the new author for the typepad book? I...
    • Lisa: @Miguel – looks like the words “in the header.php...
    • Lisa: @Alice – wonderful to hear the feedback –...
    • Lisa: @Edward, that is really great to hear :) I’ll be...
    • Lisa: Lindsey – you mean I haven’t sent you a copy yet?...
    • Lisa: You’re not kidding – this post has some serious...
    • Alice: Lisa: I finally decided to do a blog, and I bought WordPress...
    • Rick: The post that would not die… Lisa – forget about...
    • Miguel: Sorry. I meant to say background: #73a0c5...
    • Miguel: Lisa, I read your book (excellent, by the way) and I...
    • James: Lisa you are very pretty. Thanks