Lifestyle and Emerging Technology In Plain English

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

FeedBurner Logo (© FeedBurner, Inc.)
Creative Commons License photo credit: 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­burner is the ser­vice I (and many many other) blog­gers use to improve RSS Feed per­form­ance and meas­ure read­er­ship of our RSS feeds.
  • The Feed­Smith / Feed­Burner 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 Feedburner.

The cur­rent incarn­a­tion of the Feed­Smith / Feed­Burner plu­gin doesn’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­itor 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­burner. 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­Burner / Feed­Smith plu­gin. Here’s how:

  1. Nav­ig­ate to the main Plu­gins page. Scroll down until you find the Feed­burner / 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 Editor 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 button.
  5. Then, go back to the main Plu­gins page, and re-enable the Feed­Burner / 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­burner 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­burner 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­burner for you, as the Feed­Smith Plu­gin does. You’ll have to manu­ally pub­lish the Feed URL, thusly:
<a href="http://feeds.feedburner.com/BlogbradgriercomWordpress">My WordPress tag feed hosted on Feedburner</a>

Which would render thusly:

My Word­Press tag feed hos­ted on Feed­burner.

Related Posts with Thumbnails

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

  1. Ha!

    Hi Richard, thanks, your com­ment made me blow cof­fee out my nose *clean­ing the com­puter screen*…

    Cats, no, I have no wish to doc­u­ment cat alter­ing at this time. Though there are some cell­phone wield­ing drivers I’d like to alter :)

  2. @Adieska — Good ques­tion. (Sorry @Richard, I mis­read your com­ment to mean you’d like me to alter felines, not categories) :)

    Though I’ve not tried it, I ima­gine that if you take the fol­low­ing 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 set­ting up the cus­tom feed­burner feed for any cat­egor­ies you’d like to feed.

    Again, not tested, so your mileage may vary.

    – Brad

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

    I exten­ded 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 strip­ping out all the Feed URIs that Word­Press inserts into the head of the doc­u­ment (for the RSS but­ton in/by the address bar). These fil­ters grab onto things in link-template.php (in word­press 2.9.*) and your theme’s functions.php file.

    func­tion remove_rss() {
    return;
    }
    add_filter(‘post_comments_feed_link’,‘remove_rss’);
    add_filter(‘category_feed_link’,‘remove_rss’);
    add_filter(‘author_feed_link’,‘remove_rss’);
    add_filter(‘search_feed_link’,‘remove_rss’);

    Then we can go in to header.php and add just the URIs of the newly cre­ated Feed­burner feeds to the manu­ally. Such as this:

    Hope that helps some­body (you’ve got the top res­ult on my Google search query, so it’s likely other people are com­ing here too)

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

    <link rel=“alternate” type=“application/atom+xml” title=“Missingtoof.com » Full RSS Feed (All Posts)” href=“http://feeds.missingtoof.com/missingtoof” />

  6. Heh, nice work Miss­ing­toof! And thanks for tak­ing the time to share it, I’m sure someone will appre­ci­ate it, as you said, this thread is being searched and found.

    Cheers!

    –Brad