Posts Tagged ‘blogging’

Category-specifc RSS feeds from WordPress

Friday, October 24th, 2008

I subscribe to some topic-specific blog aggregation feeds, and I get mildly annoyed when posts appear on those things that actually don’t have anything to do with the aggregation’s topic.  I found this off-topic spamming surprising because blogs always have these categories and tags on every message, so what’s the point of all that if you can’t subscribe to a specific category?

It’s not exactly obvious, but it turns out that at least with WordPress blogs (like this one) you can subscribe to a particular category.

First you have to figure out the category number for the topic you’re interested in.  You can usually do that by clicking on the link for the category you’re interested in an looking at the url.  It’ll have part that says something like “cat=4″.   Then you append that onto the regular feed url.  Now you append that onto the base RSS url for the blog.  Like for this blog the base is:

http://www.billbaxter.com/techblog/wp-rss2.php

Use a “?” to tack on the category string and voila!

http://www.billbaxter.com/techblog/wp-rss2.php?cat=4

you have a category-specific feed url (in the case above, for my “code” topic, which current includes D, C++ and Python sub-categories.

Update: It seems WordPress folks changed the URL format they use at some point.  For the version I’m currently using (2.9.2), the format is now:

http://www.billbaxter.com/techblog/?feed=rss2&cat=4

The .php script referencing the type of feed is no longer explicit, and instead both feed type and category are just parameters.

So here are some category-links for my blog here (updated for my WP 2.9.2):