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

FeedBurner Logo (© FeedBurner, Inc.)
Creative Commons License photo cred­it: mag­bag

Sorry for the über tech in this post, but I thought this was a simple fix that any­one run­ning a Word­Press 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 back­ground:

  • Feed­burn­er is the ser­vice I (and many many oth­er) blog­gers use to improve RSS Feed per­form­ance and meas­ure read­er­ship of our RSS feeds.
  • The Feed­Smith / Feed­Burn­er plu­gin is a com­pon­ent for Word­Press (the blog­ging plat­form I use here) that sim­pli­fies the admin­is­tra­tion and imple­ment­a­tion of Feed­burn­er.

The cur­rent incarn­a­tion of the Feed­Smith / Feed­Burn­er plu­gin does­n’t sup­port the new Word­Press fea­ture of RSS Tag Feeds. No big deal if you don’t care about allow­ing your vis­it­ors to sub­scribe to your con­tent based on Tag. But you’re miss­ing an oppor­tun­ity to allow your read­ers to bet­ter fil­ter the con­tent if that’s the case.

For example, lets say a vis­it­or is only inter­ested in receiv­ing my posts on pho­to­graphy. They don’t care about all this tech­no­logy, web con­tent, usab­il­ity, or search engine optim­iz­a­tion that I may be writ­ing about. They only care about my pho­to­graphy posts. Word­Press 2.5+ allows you to sub­scribe to any Tag Feed or Cat­egory Feed. But not if you’re using an unmod­i­fied Feed­Smith plu­gin. Fear not, I’ve got a fix for you in a moment.

The way the cur­rent Feed­Smith plu­gin works is that it takes all my feed sub­scrip­tion requests (com­ment, cat­egory, tag, etc) and returns only the main blog RSS feed, which is the main feed at Feed­burn­er. Not good if you want to have an RSS Feed of only my pho­to­graphy tagged posts.

The work­around is quite simple and requires slightly modi­fy­ing your Feed­Burn­er / Feed­Smith plu­gin. Here’s how:

  1. Nav­ig­ate to the main Plu­gins page. Scroll down until you find the Feed­burn­er / Feed­Smith plu­gin. Click on the Dis­able link in the right-hand column. When the page refreshes, scroll back down and click on the Edit link.
  2. The Plu­gin Edit­or screen will open. Scroll down in the edit win­dow until you find the func­tion function ol_feed_redirect()
  3. In that sec­tion 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 bot­tom of the page and press the Update File but­ton.
  5. Then, go back to the main Plu­gins page, and re-enable the Feed­Burn­er / Feed­Smith plu­gin by click­ing on the Enable link.

Con­grat­u­la­tions, you’ve just re-enabled Tag RSS Feeds for your Word­Press 2.5+ blog whilst main­tain­ing Feed­burn­er com­pat­ib­il­ity for the main feed.

Bonus for the advanced stu­dent: Since your Tag RSS Feeds are now sep­ar­ated from the main blog feed, you can set up dis­creet Feed­burn­er feeds for select tags. Unfor­tu­nately the little hack above won’t auto­ma­gic­ally redir­ect RSS Sub­scrip­tions to Feed­burn­er for you, as the Feed­Smith Plu­gin does. You’ll have to manu­ally pub­lish the Feed URL, thusly:
<a href="">My WordPress tag feed hosted on Feedburner</a>

Which would render thusly:

My Word­Press tag feed hos­ted on Feed­burn­er.

Published by Brad Grier geek.hack