Updated this post to reflect Matt’s comments and replace /wp-inst/wp-rss2.php by /feed/.
Just extending on Lorelle’s Customozing RSS Feed Links for Wordpress.com and Wordpress Sidebar Widgets which provides useful suggestions for customizing Wordpress feeds, even for searches. Reading that article made me delve into more ways of syndicating specific content. Feed templates can also be modified for more granular control. If feeds are still Greek to you, Introduction to Syndication and Wordpress Feeds will bring you up to speed.
Now, more customization for RSS feeds in Wordpress! Wordpress executes the Wordpress Loop and the associated queries for producing the feeds. This implies that rules that apply for creating index, archive, searchor custom queries can be used for creating the feeds. It is kind of single-source publishing, same queries to be used for same content, irrespective of whether it displayed on the web or syndicated via the feed.
Let us see what this means for us. In addition to the default feeds, now we can provide additional partial feeds for posts created using Wordpress queries, e.g., posts for last two days or order posts alphabetically or posts by a specific author in a multi-author blog. Say, one of your visitors is interested only in two categories and not all of them. Using this blog as an example, lets create a feed for categories blogging and wordpress.
All the examples given below are relative URLs with respect to the root of the blog, i.e., the URLs displayed below are appended to http://iface.wordpress.com/.
feed/?category_name=blogging
&category_name=wordpressWe have specified the category names as arguments to the file wp-rss2.php which produces the RSS feeds. If you are not afraid of handling IDs, the same result can be obtained using:
Here, 91 is the category ID of the category blogging and 33 that of wordpress. This is so convenient for my reader who would otherwise had to subscribe to the entire feed and filter through the posts or subscribe to two feeds, one per category. This would be intolerable if the reader was interested in 10 categories out of 20.
Now consider a case where your visitor is interested in 9 out of 10 categories, that is you want to eliminate posts for one category from the feed. I am trying document all Wordpress global variables on this blog, and all of them are filed under the wordpress global variables category. A reader, not interested in the Wordpress plugins or theme development, might not interested in the wordpress global variables category posts. Here is how it can be done:
will remove the posts under wordpress global variables in this blog.
Techniques mentioned in Alphabetizing Posts can be used on the query, e.g.,
feed/?cat=91+33&orderby=title&order=asc
will result in the feed having alphabetically ordered posts.
will produce a feed for posts by me, even if there were more authors writing on this blog.
If it is useful, feeds can also be produced for pages, following are multiple ways:
While all the above examples can be used for a Wordpress.com blog, they are applicable even to an independent blog. As a blog owner, you can probably create such feeds for specific readers of your blog.
Wordpress gives you the ability to customize the RSS feeds by letting you run customized queries, this gives the ultimate power to the blog owner and the reader.
Technorati tags: rss, feeds, custom+feeds
Copyright Abhijit Nadgouda.



April 19th, 2006 at 10:42 am
Please don’t use
wp-instin any URLs, it could break at any time. You can use /feed/ URLs for all of your examples above.April 19th, 2006 at 11:37 am
Thanks for the clarification Matt, I will update the examples accordingly.
April 19th, 2006 at 3:05 pm
[...] Ultimate Wordpress RSS Feed Customization I am always looking for ways to read less, not more. Abhijit Nadgouda’s primer for customizing RSS feeds explains how to provide customized partial feeds for posts by running customized queries. We’re one step closer to personalized content. (tags: RSS wordpress personalization guides) [...]
May 17th, 2006 at 10:23 pm
[...] More customized syndication [...]
July 23rd, 2006 at 6:40 pm
[...] If you feel that you don’t want to read about the programming posts, you can subscribe to this feed which does not include the posts under programming category. Head over here for more customization. [...]
July 26th, 2006 at 3:35 am
Is there a parameter to limit the number of posts from a category? Let’s say I only want the 5 most recent posts from a category.
July 27th, 2006 at 12:06 am
Hi August,
Wordpress lets you specify the number of posts in a feed in the admin area on Options -> Reading page under Syndication Feeds. This is retrieved from the database.
It cannot be controlled through the query. Hope this helps.
November 17th, 2006 at 3:37 pm
[...] Seth Godin brings up problem of keeping up with bloggers (via Lorelle). This is one of the reasons I do not subscribe to a lot of team blogs and even professional bloggers. I have subscribed for some, but it is because quality is what stands out, not quantity. I want to read blogs for information, not information overload. Somedays the posts are many more, but if they are of the interest then the fatigue does not interfere. Fatigue is not a function of only the number of posts, but also of the interest in the posts. I have realised that subscribing to individuals has been better than subscribing to blogs where multiple authors churn out posts. I might be missing out on some of the top blogs, but I hardly miss any news! In fact I get a chance to skip the hyped up stuff easily because of this. Dave Winer, Doc Searls, Robert Scoble and Lorelle are only some of the individuals who offer more value than many of the team blogs out there. As for the team blogs, they can probably provide customizable feeds so that the reader can choose to subscribe to a subset. [...]
June 24th, 2007 at 12:50 pm
[...] by readers to keep themselves updated. WordPress generates feeds for both pages and posts and various other queries, which you can offer to your reader and customers. It is also quite popular that these feeds can be [...]
July 8th, 2007 at 3:17 pm
[...] feeds with query string My googling led me to ifacethought’s page on RSS feed customization, so I initially contemplated on changing my Feed URL by adding a query string to my RSS icon (see [...]
September 25th, 2007 at 9:58 pm
[...] also has some terrrific featuers, like flexible feed customization, which makes it easier to get a customized feed for yourself. The template heirarchy can be very [...]
October 23rd, 2007 at 9:40 pm
[...] far as I know, Wordpress has the most customizable syndication available. Movable Type does support full and category based syndication, but still not as flexible [...]