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

  • featured
    $9

    QR Codes Widget

     (3)
    Add a widget with QR codes to your AppThemes site.
  • stripe-plugin
    $39

    Stripe

     (4)
    Process credit cards safely and securely on your AppThemes website.
  • Authorize.Net Thumbnail
    $39

    Authorize.Net

     (3)
    Easily start accepting online payments via credit card and e-check.
  • daddy-likes-190x130
    $19

    Daddy Like

     (10)
    A fast, lightweight, and elegant "like" system for comments, pages, posts, & activities.
  • StarStruck WordPress Plugin Thumbnail
    $19

    StarStruck

     (16)
    A fast, lightweight, and elegant star rating system for comments, pages, & posts.
  • 2Checkout Payment Gateway Plugin
    $39

    2Checkout

     (4)
    Accept up to eight payment methods, fifteen languages, & twenty six currencies.
  • critic-icon-2
    $39

    Critic

     (7)
    A professional review and rating system for WordPress.
  • marine-marketplace-thumb
    $39

    Marine

     (1)
    A clean, modernĀ and fully responsive marine-based goods WooCommerce Theme.
  • screenshot
    $39

    Convert

     (2)
    A conversion focused responsive Clipper child theme with premium features.
  • autoauto-thumbnail
    $39

    AutoResponder AutoRegistration

     (4)
    Automatically integrates WordPress registration with major autoresponders.
  • pcp-featured
    $39

    Price Comparer

     (3)
    Jump start your Price Comparision site with products from Amazon, Commission Junction, and LinkShare.
  • AppThemes Coupon Plugin
    $29

    AppThemes Coupons

     (8)
    An easy way to start offering coupons and promotions to your customers.
  • GeoReg thumbnail
    $29

    GeoReg

     (10)
    Captures detailed geographic info with new user registrations.
  • balanced-payments-plugin-sm
    $39

    Balanced Payments

     (3)
    Accept credit cards and setup escrow payments.
  • adposter-blocker-thumbnail
    $9

    AdPoster Blocker

     (2)
    A simple but powerful plugin that blocks spammy new user regs and/or ads/jobs/posts.