Tweaking your FeedBurner / FeedSmith plugin to support WordPress 2.5+ tag feeds (easy!)

FeedBurner Logo (© FeedBurner, Inc.)
Creative Commons License photo credit: magbag

Sorry for the uber tech in this post, but I thought this was a simple fix that anyone running a WordPress 2.5+ blog could do if they wanted to enable ‘Tag Feeds’.

Before I get into the how, let’s explore the why briefly.

Some background:

  • Feedburner is the service I (and many many other) bloggers use to improve RSS Feed performance and measure readership of our RSS feeds.
  • The FeedSmith / FeedBurner plugin is a component for WordPress (the blogging platform I use here) that simplifies the administration and implementation of Feedburner.

The current incarnation of the FeedSmith / FeedBurner plugin doesn’t support the new WordPress feature of RSS Tag Feeds. No big deal if you don’t care about allowing your visitors to subscribe to your content based on Tag. But you’re missing an opportunity to allow your readers to better filter the content if that’s the case.

For example, lets say a visitor is only interested in receiving my posts on photography. They don’t care about all this technology, web content, usability, or search engine optimization that I may be writing about. They only care about my photography posts. WordPress 2.5+ allows you to subscribe to any Tag Feed or Category Feed. But not if you’re using an unmodified FeedSmith plugin. Fear not, I’ve got a fix for you in a moment.

The way the current FeedSmith plugin works is that it takes all my feed subscription requests (comment, category, tag, etc) and returns only the main blog RSS feed, which is the main feed at Feedburner. Not good if you want to have an RSS Feed of only my photography tagged posts.

The workaround is quite simple and requires slightly modifying your FeedBurner / FeedSmith plugin. Here’s how:

  1. Navigate to the main Plugins page. Scroll down until you find the Feedburner / FeedSmith plugin. Click on the Disable link in the right-hand column. When the page refreshes, scroll back down and click on the Edit link.
  2. The Plugin Editor screen will open. Scroll down in the edit window until you find the function function ol_feed_redirect()
  3. In that section you’ll be adding text to a line of code. Change the text that reads
    is_feed() && $feed != 'comments-rss2' && !is_single() &&
    to read
    is_feed() && $feed != 'comments-rss2' && !is_single() && !is_tag() &&
  4. Scroll to the bottom of the page and press the Update File button.
  5. Then, go back to the main Plugins page, and re-enable the FeedBurner / FeedSmith plugin by clicking on the Enable link.

Congratulations, you’ve just re-enabled Tag RSS Feeds for your WordPress 2.5+ blog whilst maintaining Feedburner compatibility for the main feed.

Bonus for the advanced student: Since your Tag RSS Feeds are now separated from the main blog feed, you can set up discreet Feedburner feeds for select tags. Unfortunately the little hack above won’t automagically redirect RSS Subscriptions to Feedburner for you, as the FeedSmith Plugin does. You’ll have to manually publish the Feed URL, thusly:
<a href="">My WordPress tag feed hosted on Feedburner</a>

Which would render thusly:

My WordPress tag feed hosted on Feedburner.

Related Posts with Thumbnails

20 Replies to “Tweaking your FeedBurner / FeedSmith plugin to support WordPress 2.5+ tag feeds (easy!)”

  1. Ha!

    Hi Richard, thanks, your comment made me blow coffee out my nose *cleaning the computer screen*…

    Cats, no, I have no wish to document cat altering at this time. Though there are some cellphone wielding drivers I’d like to alter 🙂

  2. @Adieska – Good question. (Sorry @Richard, I misread your comment to mean you’d like me to alter felines, not categories) 🙂

    Though I’ve not tried it, I imagine that if you take the following text:
    is_feed() && $feed != 'comments-rss2' && !is_single() &&
    to read
    is_feed() && $feed != 'comments-rss2' && !is_single() && !is_tag() &&

    and change the last line to read:
    is_feed() && $feed != 'comments-rss2' && !is_single() && !is_tag() && !is_category() &&

    it ‘may’ work.

    Then you’d have to go through the same hoops of setting up the custom feedburner feed for any categories you’d like to feed.

    Again, not tested, so your mileage may vary.

    — Brad

  3. Great post. This was exactly what I needed.

    I extended the code to include author feeds like this:

    is_feed() && $feed != ‘comments-rss2’ && !is_single() && !is_tag() && !is_author() &&

  4. Thanks for the tip. I went a step farther stripping out all the Feed URIs that WordPress inserts into the head of the document (for the RSS button in/by the address bar). These filters grab onto things in link-template.php (in wordpress 2.9.*) and your theme’s functions.php file.

    function remove_rss() {

    Then we can go in to header.php and add just the URIs of the newly created Feedburner feeds to the manually. Such as this:

    Hope that helps somebody (you’ve got the top result on my Google search query, so it’s likely other people are coming here too)

  5. The XHTML was parsed out above. This would go in the <head>

    <link rel=”alternate” type=”application/atom+xml” title=” » Full RSS Feed (All Posts)” href=”” />

  6. Heh, nice work Missingtoof! And thanks for taking the time to share it, I’m sure someone will appreciate it, as you said, this thread is being searched and found.



Comments are closed.