Getting Specific with WordPress Feeds

RSS Feeds

I was recently reading a post by Justin Germino, who had a problem using his main WordPress RSS feed because it shows every post on his blog, including guest posts. He wanted a way to only display posts written by him and found that WordPress has built-in functionality to do this.

Author feeds

An author feed was the solution that Justin was looking for. It’s a special feed that is automatically created by WordPress (no coding required!). It only displays posts written by the specified author and one is created for every single author you have.

To use an author feed, just use this address:

and change the domain for your own blog’s domain and the author name (dave) for your own author name.

Category feeds

You can also use feeds that only display posts within a certain category. For example, I could use the following feed to only display posts in my WordPress category:

Child category feeds follow the slug patterns you give them when setting up your categories. So for example, to only show posts in my Basics category, which is a sub-category of my WordPress category, I would use the following feed:

You can also use category IDs if you prefer, but I’m going to refer you to the Codex if you want to learn how to do that, as I believe using the category slug is much better.

Tag feeds

The tag feed is very similar to the category feed. Simply swap out the tag (security) and domain in the following example to create a feed for posts with a particular tag:

Again, you can use tag IDs if you wish, but you’re just creating extra work for yourself. Answers in the Codex article referenced above if you’re interested though.

Comment feeds

These feeds are handy for staying up-to-date on what is being said about a particular post. While some WordPress blogs give you the functionality to subscribe to comments by email when you comment, you normally have to comment yourself, and be OK with the comments clogging up your inbox. Your preferred method might be to get those comments using an RSS feed.

Again, this is included as standard in WordPress and you just need to add /feed/ to the end of the post permalink. So for example, the comments feed for this post is:

And there’s even a feed which includes comments from all posts. Just add /comments/feed/ to the end of the domain name. For example:

Search results

Now here’s a pretty interesting one. You can create a feed for a particular search expression, and it will return posts that match your search expression. This is a powerful tool that you can use to get notified of specific information from other WordPress sites. For example, if I want to be notified of every article on Mashable that mentions the iPhone, I can use the following feed address:

In order to configure it to your specific needs, you need to change the domain to the site you’re interested and the search term (iphone in this case) to the one that you’re interested in. If you want to use a search term that has two different words, like “social media”, then swap out the space out for a plus sign. For example:

A quick shortcut

If you’re having trouble with the syntax of a particular feed, you can use this quick workaround to save you the trouble. If your browser auto-discovers feeds (most do these days), then you can simply navigate to the appropriate page and the feed shown when you hit the RSS icon should be the one you’re looking for.

For example, if you go to any category page on my site, when you click the auto-discover icon, you’re not only given the main site feed, but you’re also given a feed for that category. The same applies when you go to posts (for comments), tag pages and author pages, though it doesn’t appear to work for search results.

Justin already came up with a great use for these more specific feeds. What do you use them for?

UPDATE: 3/17/11

Custom post type feeds

After creating a custom post type for a client, I hadn’t realised that post using the custom post type don’t appear in the main WordPress RSS feed. However, as with categories and tags, custom post types have their own RSS feed. So for example, a custom post type that I recently provided for a client was called gallery and the RSS feed for that custom post type is: http://www.simontickett.com/feed/?post_type=gallery

21 thoughts on “Getting Specific with WordPress Feeds”

  1. Tristan says:

    Great post, Dave! This is something I’ve been vaguely familiar with, but I really appreciate the reminder. I’ll be implementing the category feed and search feed into my blog. Thanks, buddy.

    Post retweeted!

    1. Dave says:

      Thanks Tristan. Both the praise and the tweet are much appreciated!

  2. Tia says:

    Hey Dave!

    I have to use specific feeds for my blog as well. Just today, I made the “main” feed which goes to my Feedburner the technology category feed, because my RSS subscribers prior to Jan 1 were receiving blogging info, and when I introduced new post subjects (several times per day) all of a sudden they were receiving multiple, un-related updates. That was probably annoying (I suspect).

    So the plan is to create a specific RSS feed for each of my categories, much like the bigger digital magazines do, and a main one. That will allow RSS subscribers to pick and choose the feeds they want, rather than being forced to get everything.

    The author feed comes in really handy with Scribnia and places like Ezinearticles (which just occurred to me as I’m writing this)!

    Cheers,
    Tia

    1. Dave says:

      When I first started getting into reading blogs and subscribing to RSS feeds, I was often put off by the larger sites which didn’t have category specific feeds. At the time, I wasn’t aware of WordPress’ functionality in this arena and that I could figure out the syntax for the feed even if it wasn’t displayed, but I just ended up not subscribing to their feed because I wasn’t interested in all the other stuff they were talking about. Once you start getting big and creating more content and in more categories, advertising your RSS feeds is certainly a worthwhile exercise. Glad to hear that you’re expanding and finding need for using this!

      Hope 2011 goes amazing

  3. Ileane says:

    Hi Dave, I love this tip. I haven’t had to use it yet but I’m sure it will come in handy. After you’ve burned the desired feed to Feedburner, this could work as your CommentLuv feed too (for example, if you wanted to exclude guest posts). Wonder if Justin is using it that way? Hmm…

    1. Dave says:

      Hi Ileane,

      You absolutely could. Once you’ve selected your desired feed, you could make that a FeedBurner feed and then use it in any number of applications, like feed aggregators (and CommentLuv) if you want to exclude certain types of posts from those sites. Excellent point!

      Thanks for your comment, hope you’re doing well!

  4. Tanya says:

    Any ideas what I could be doing wrong? When I try to create a feed for a specific category, I get this error: The URL does not appear to reference a valid XML file.

    I entered it just as you suggested but it’s just not working. Any thoughts you have would be appreciated!

    1. Hi Tanya,

      Can you please post the exact address of the feed that you’re trying to use? I’ll have a look. Thanks!

  5. Tanya says:

    The feed I’ve been trying is http://www.blogelina.com/category/the-blogging-buddy-network/feed.

    Thanks so much for looking at this for me!

    1. Hmmm, well first I got the some errors when I entered the address you gave me into Chrome, which made me think you had a conflict with the WassUp plugin:

      Then, i tried going to the category (http://www.blogelina.com/category/the-blogging-buddy-network/) in question on your site and was instead redirected to a single post (http://www.blogelina.com/2011/01/blogelinas-blogging-buddy-blog-hop-or-bbbbh/). Do you have some kind of redirect on that category that is making this happen?

  6. Tanya says:

    I de-activated the Wassup plugin just now. I only have one post in that category so far – could that be why it redirects to the post? Otherwise, I don’t know why it would be redirected there.

    An aside question – do you like Chrome? I’m using Firefox and getting a bit fed up with it crashing all the time.

    1. Hmmm there’s definitely something screwy going on with your site – I tried going to a few different categories using the category cloud in your sidebar and each time I did, I landed on a Page Not Found. Something is upsetting your WP installation and that’s causing the category feeds to fail.

      I love Chrome. I used to be a die-hard Firefox fan, but moved to Chrome about 18 months ago and I haven’t looked back. It’s solid, secure, lightning quick and immensely simple, yet extensible. I’d recommend to everyone to convert.

  7. Stéfan says:

    Hi

    Do you know if there’s a way to get a feed of all comments made on all posts from a specific user ?
    The objective is to allow each author of a multi-author blog to be able to keep track of comments on his posts.

    1. Hi Stefan,

      I’m not sure that this is possible I’m afraid. You have an author specific feed, which returns posts for each author (but not the comments on the posts) and then comment feeds for each individual post, so a workaround would be to have each author subscribe the comments feed of every post for which they are the author. I don’t believe there is an inherent way to create a single feed for this issue.

      Good luck!

  8. ron says:

    Hi,

    Great post above.

    I’ve just managed to create category specific RSS feeds using your tip http://www.doitwithwordpress.com/category/wordpress/feed/.

    How do I make comment feeds from specific categories?

    Regards and thanks

    1. Ron, unfortunately, the only way you’d be able to do that is if you indivdually added all the comments feeds from a particular category to a single feed and updated it manually every time a new post was added to that category. WordPress does not have the functionality to do this natively I’m afraid.

  9. Okay I need be more specific I am trying to return an XML feed.
    I tried using:

    http://blogs.colgate.edu/?feed=rss2&cat=9

    That simply returns all the posts but it converts it to

    http://blogs.colgate.edu/category/faculty/feed

    Do I need to make a separate RSS2.php file for specific catagories?

    1. Hi David,

      I tried the link you had supplied, and it didn’t appear to return the full list of posts that are visible at http://blogs.colgate.edu. Does the front page show posts from all categories? If so, I’d say that it appears to be working as intended.

      Let me know if I can be of further help.

      1. I need to be more specific I think. I am fairly new to WordPress/PHP but have been a web programmer for about 10 years.

        I need to pull a feed from our blog to grab just the posts that our categorized “faculty” and then I display the top four posts on another page on http://www.colgate.edu. I have been trying to add another RSS template to my WordPress instance but so far I am not successful. Sorry if I am way off base here in this thread.

  10. jayhobbs says:

    Thanks Dave. This post, although quite old, is quite timely for me. It has helped me create a selective MailChimp RSS feed campaign. MailChimp suport did not know how to do it, but you do. For example, I have on MailChimp campaign that sends out EVERY blog post and one that sends out MONTHLY Previews and feed summaries of the last 5 or so daily posts. I set up a “Frequency” CATEGORY in WordPress, with “Monthly” and “Daily” children categories. With your inspiration, I set those up to select those in MailChimp RSS feed campaigns that send out Monthly and daily, respectively.

    1. Fantastic! Thanks for letting us know how you were able to apply this to your needs.

Leave a Reply