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

by Brad Grier on June 23, 2008

in Blogging,How to,Social Media

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
Like this? Share it please!
  • Twitter
  • Digg
  • Facebook
  • RSS
  • Suggest to Techmeme via Twitter
  • del.icio.us
  • LinkedIn
  • Posterous
  • Reddit
  • StumbleUpon

{ 13 comments… read them below or add one }

1 Richard Miller (Sparkletack) July 10, 2008 at 1:10 am

Hi Brad,

Stumbled across your site on a question to hack the FeedSmith plugin to work with category feeds. Your explanation of altering it to work with tag feeds is so beautifully clear and concise, I wonder if you wouldn’t mind doing the same for cats!

Thanks …

Richard Miller (Sparkletack)s last blog post..SFWeekly: “Nonconformity Still Reigns”

2 Brad Grier July 10, 2008 at 8:11 am

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 :)

3 Adieska August 13, 2008 at 10:19 am

Wow… Thanks for this tutorial. This is help us so much. I also wondering if you can make a feed also for the category. Same question as Richard Miller :)

Adieskas last blog post..Kenny Chesney: CMA 2008 Entertainer of the Year

4 bgrier August 13, 2008 at 10:54 am

@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

5 Anthony October 23, 2008 at 6:44 am

Thanks for your help, this was exactly what I was looking for!

6 Brad Grier October 23, 2008 at 8:15 am

@Anthony – My pleasure Anthony. Always happy to help :)

7 Chad A. Johnson December 11, 2008 at 3:16 pm

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() &&

8 Brad Grier December 11, 2008 at 10:01 pm

@Chad, good call, thanks for posting that extension!

9 realsurf (mrRealSurf) February 9, 2009 at 7:05 pm

FriendFeed Comment


Tw… [link to post]

– Posted using Chat Catcher

10 Missingtoof January 24, 2010 at 6:24 pm

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() {
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 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)

11 Missingtoof January 24, 2010 at 6:25 pm

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” />

12 Missingtoof January 24, 2010 at 6:31 pm

…damn, with your own title and URI, of course.

13 Brad Grier January 24, 2010 at 8:48 pm

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.

Cheers!

–Brad

Leave a Comment

{ 4 trackbacks }

Thesis Theme for WordPress:  Options Galore and a Helpful Support Community
Creative Commons License
blog.bradgrier.com by Brad Grier is licensed under a
Creative Commons Attribution-Noncommercial-Share Alike 2.5 Canada License.
Based on a work at blog.bradgrier.com.
ss_blog_claim=44aa26329ed37448560e7d4275ad1ef0