Redirect Your WordPress Feed to Feedburner

feedburner-icon

We’ve been doing quite a bit of Marketing the past couple of weeks and one of our initiatives was to better track our readers. Like most business websites, we use Feedburner for RSS & email syndication.

Not only does it make it easier for people to subscribe to our outbound communication channels, Feedburner also gives us the analytical tools to dig into the data.

As we launch new sites (most recently our AppThemes WordPress Marketplace), certain steps are taken before public release. One of which is setting up a new feed and pointing it to Feedburner.

Pointing your feed to Feedburner

Unlike many other tutorials that instruct you to edit your theme’s header.php file (which is the wrong way), we recommend creating a child theme or adding the following function to your functions.php file.

// replace the default posts feed with feedburner
function appthemes_custom_rss_feed( $output, $feed ) {
    if ( strpos( $output, 'comments' ) )
        return $output;
 
    return esc_url( 'http://feeds.feedburner.com/AppThemes/' );
}
add_action( 'feed_link', 'appthemes_custom_rss_feed', 10, 2 );

What this does is dynamically change your main posts feed (rss, rss2, atom, and rdf) throughout your site. It ignores the comments feed.

Test it out by going to http://www.yoursite.com/feed/. You should be prompted to subscribe via Feedburner and then you’re done!

Bonus Points

Besides your main site’s feed, there are feeds for each tag, category, taxonomy, author, and search. If you wanted to point these to Feedburner as well, you’d use the following filters:

add_filter( 'tag_feed_link', 'custom_tag_rss_feed' );
add_filter( 'category_feed_link', 'custom_cat_rss_feed' );
add_filter( 'taxonomy_feed_link', 'custom_tax_rss_feed' );
add_filter( 'author_feed_link', 'custom_author_rss_feed' );
add_filter( 'search_feed_link','custom_search_rss_feed' );

For example, we created a separate Feedburner feed just for our tutorials category. This allows people to read just our awesome tutorials without having to sort through everything that comes from our Docs site. You can see it available on our AppThemes subscribe page.

function appthemes_custom_cat_rss_feed( $output ) {
    if ( strpos( $output, '/tutorials/feed' ) )
        return $output = esc_url( 'http://feeds.feedburner.com/AppThemesMarketplace/' );
    else
	return $output;
}
add_filter( 'category_feed_link', 'appthemes_custom_cat_rss_feed' );

Summary

Creating separate Feedburner feeds for all your categories, authors, etc would be laborious and not worth doing. Either just provide your main rss feed or pick a few top categories that your readers might want direct feeds to.

Like this tutorial? Subscribe and get the latest tutorials delivered straight to your inbox or feed reader.

Your rating: none
Rating: 4.4 - 7 votes

Written by: on September 22, 2012. Last modified: September 22, 2012

Popular Marketplace Items

  • autoauto-thumbnail
    $39

    AutoResponder AutoRegistration

     (4)
    Automatically integrates WordPress registration with major autoresponders.
  • featured
    $9

    QR Codes Widget

     (3)
    Add a widget with QR codes to your AppThemes site.
  • dear-seven-responsive-multipurpose-theme-thumbnail
    $39

    Envelope

     (1)
    A responsive multi-purpose WordPress theme for business or personal portfolio.
  • Ad Stuffer for Jobroller by Appthemes
    $19

    Ad Stuffer JobRoller

     (1)
    Stuff your JobRoller Theme with 14 extra Ads & Links!
  • critic-icon-2
    $39

    Critic

     (6)
    A professional review and rating system for WordPress.
  • StarStruck WordPress Plugin Thumbnail
    $19

    StarStruck

     (14)
    A fast, lightweight, and elegant star rating system for comments, pages, & posts.
  • thumbnail-vantage-image-slider
    $19

    Image Slider for Vantage

     (2)
    Replace the Vantage listing and events gallery with an image slider.
  • thumbnail
    $29

    Ad Injector

     (3)
    Inject adverts directly into listings and search results. Works with multiple themes.
  • dear-seven-responsive-multipurpose-theme-thumbnail
    $39

    Creative

     (2)
    A responsive multi-purpose WordPress theme for business or personal portfolio.
  • GeoReg thumbnail
    $29

    GeoReg

     (10)
    Captures detailed geographic info with new user registrations.
  • adposter-blocker-thumbnail
    $9

    AdPoster Blocker

     (2)
    A simple but powerful plugin that blocks spammy new user regs and/or ads/jobs/posts.
  • thumbnail-vantage-user-locator
    $19

    User Locator for Vantage

     (7)
    Auto-detect & add your visitors location using geo coordinates.
  • daddy-likes-190x130
    $19

    Daddy Like

     (10)
    A fast, lightweight, and elegant "like" system for comments, pages, posts, & activities.
  • pcp-featured
    $39

    Price Comparer

     (3)
    Jump start your Price Comparision site with products from Amazon, Commission Junction, and LinkShare.