The recent integration of the tumblog into the regular Daily Cup of Tech posts, I was provided with the opportunity to play with the customization of my WordPress based RSS feeds. While it took me a bit of effort and research, I was able to come up with some really good ways to make my RSS feeds my own.
Since I did have to put in some legwork to get this to work for me, I thought that I would document what I learned I could do and let everyone else in on some of the tricks.
I am certain that I have not discovered everything that WordPress can do with an RSS feed so please feel free to add your tricks in the comments.
The Full Feed
For a WordPress blog, the most common feed is the full feed. This is every single post in the entire blog. If your domain name was MyAwesomeDomainName.com, then your RSS feed would be either:
With the tumblog integration, I wanted to create specific feeds based on categories. I discovered that this was a relatively simple thing to do. In fact, you can create custom feeds based on several different criteria. All I needed to do was decide on whether I wanted to create an exclusive feed, an inclusive feed, or a multiple criteria feed.
The exclusive feed will only show information based on individual criteria. For example, a feed that only shows posts that are written by Tim Fehlman. This custom feed would look something like this:
The inclusive feed contains everything in the blog but one criteria. An example of an inclusive feed would be every post on the blog except for posts in the Tumblog category (Why does that sound familiar?). You feed link may look like this:
Multiple Criteria Feed
The exclusive and inclusive feeds are very easy to set up since they generally have only one criteria. It is possible to create very complex feeds to suit almost any need. For example, it is possible to create a feed that shows all feeds written on December 14th containing the keyword gift, written by Tim Fehlman in the Tech Toys category but not in the Bad Idea category. This feed might look something like this:
All custom feeds are created using parameters. Here is a list of parameters that I have discovered works with WordPress. I am certain that there are more that I have not discovered and I will attempt to keep this list up as more are discovered or reported to me.
- cat - category ID (e.g. 23)
- author - author ID (e.g. 14)
- year - year the post was published (e.g. 2007)
- day - day of the month the post was published (e.g. 17)
- monthnum - number of the month the post was published (e.g. 6)
- hour - hour of the day the post was published (e.g. 23)
- minute - minute of the hour the post was published (e.g. 48)
- second - second of the minute the post was published (e.g. 51)
- p - the unique post ID to display (e.g. 629)
- paged - specific page number as displayed on the main blog page (e.g. 3)
Simply add these parameters and desired values to your full RSS feed URL in the format:
If you want to exclude a value from your feed results, simply put a - sign in front of the value:
To combine multiple criteria, concatenate them with the & symbol:
Note: In order for your RSS feed to know that you are passing parameters to it, you need to indicate this to it by using the ? symbol. Depending on which version of the full RSS feed you are using, you may have to add it at the end of the full RSS feed it is not already in the RSS feed URI. Otherwise, concatenate the extra parameters using the & symbol.
A Special Parameter
It is also possible to create search feeds. By using the s parameter, you can search for a word within a post. For example, if you wanted to generate a feed where only the word autoit appears, it may look something like this:
Here are a few other useful resources that I found:
- WordPress Feeds
- Customizing RSS Feed Links for Wordpress.com and WordPress Sidebar Widgets
- Excluding Categories from RSS Feed