Support » Plugins » Creating Custom RSS Feed

  • My blog contains articles on a wide variety of subjects in about a dozen categories. I am trying to figure out a way to create multiple customized RSS feeds that only include content from certain categories to feed different aggregator sites. I’m not talking about a single feed for each category, but 3 or 4 different feeds that each contain a different combination of categories. For example:

    Feed 1: include all categories
    Feed 2: include category 3-7-8-11
    Feed 3: include category 1-2-3-7-10

    I was looking at the advanced category excluder plugin thinking it might be helpful, but I didn’t see much in the way of documentation on the site.

    Any ideas or suggestions would be most appreciated. On a scale of 1 to 10, my php skill level is only about a 1.


Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator Scott Reilly


    WordPress & Plugin Developer

    WordPress will create custom feeds on-the-fly for you if you provide additional query arguments:

    <a href=",7,8,11">Feed 2</a>
    <a href=",2,3,7,10">Feed 3</a>

    Obviously, modify the domain to match the root of your WP site (which, if running in a subdirectory, should also be included: i.e.

    Thanks coffee2code. I did some more research after posting this yesterday and came across several different solutions. I will give it a try this weekend.

    How about creating an RSS feed from a sidebar widget’s content? I have a widget that creates a new statement in a div in my sidebar; it changes every night at midnight and remains there all day. The content statement comes from a flat text file, not from the WP loop. I’d like to create a separate RSS feed simply for this. (Everything I have seen relies on the content being within the Loop.)

    A good example of what I want to to can be seen at, the Excuse of the Day.


    Adding a feed can be done in a plugin fairly easily.

    First, you create a function to output your feed. Like so:

    function my_feed_function() {
    header('Content-Type: text/xml; charset='.get_option('blog_charset'), true);
    <rss version="2.0">
    ... blah blah, output your feed content here however you like...
    } // end of function

    Then, the key part. Give your feed a name and call the add_feed function:

    Then by somebody can go to your site’s /feed/myfeed to get your feed (or ?feed=myfeed, if you use default permalinks).

    I would like to add an RSS function to the Events plugin I’m using.

    Otto42, this seems to be what you are describing, but I’m not clear on how to implement you instructions.


    The solution Coffee2Code provided no longer works. WordPress 2.7 has this url redirect to only a feed for the first category.

    Is there a new way to do this?

    Agreed! Is there another way to easily create an RSS feed from a category (I’m already excluding this category with another plug-in, but can’t find an easy way to create a separate RSS feed). Any ideas?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Creating Custom RSS Feed’ is closed to new replies.