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

  • pcp-featured
    $39

    Price Comparer

     (3)
    Jump start your Price Comparision site with products from Amazon, Commission Junction, and LinkShare.
  • StarStruck WordPress Plugin Thumbnail
    $19

    StarStruck

     (18)
    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.
  • wp-smart-export-final
    $25

    WP Smart Export

     (6)
    A highly customizable WordPress data exporter plugin.
  • autoauto-thumbnail
    $39

    AutoResponder AutoRegistration

     (4)
    Automatically integrates WordPress registration with major autoresponders.
  • adposter-blocker-thumbnail
    $9

    AdPoster Blocker

     (4)
    A simple but powerful plugin that blocks spammy new user regs and/or ads/jobs/posts.
  • Authorize.Net Thumbnail
    $39

    Authorize.Net

     (4)
    Easily start accepting online payments via credit card and e-check.
  • featured
    $9

    QR Codes Widget

     (4)
    Add a widget with QR codes to your AppThemes site.
  • classpress tabber
    $12

    CP-Tabber

     (1)
    Show specific custom fields as tabs on an ad detail page.
  • woo_goodstore_thumb
    $39

    GoodStore

     (1)
    A clean, modernĀ and fully responsive WooCommerce Fashion Theme.
  • critic-icon-2
    $39

    Critic

     (7)
    A professional review and rating system for WordPress.
  • woo_marine_thumb
    $39

    Marine

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

    Stripe

     (5)
    Process credit cards safely and securely on your AppThemes website.
  • at_autosuggest_taskerr_thumb
    $19

    AutoSuggest – Taskerr

     (1)
    Automatically suggests services as the user types.
  • GeoReg thumbnail
    $29

    GeoReg

     (10)
    Captures detailed geographic info with new user registrations.
  • Custom Greeting
    $6

    Custom Greeting

     (1)
    Easily replace the default WordPress greeting.
  • thumnail
    $19

    Category Icons

     (2)
    Add icons to your ClassiPress categories
  • screenshot
    $39

    Convert

     (5)
    A conversion focused responsive Clipper child theme with premium features.
  • balanced-payments-plugin-sm
    $39

    Balanced Payments

     (3)
    Accept credit cards and setup escrow payments.
  • AppThemes Coupon Plugin
    $29

    AppThemes Coupons

     (10)
    An easy way to start offering coupons and promotions to your customers.
  • classipress-fortumosms-gateway
    $39

    Fortumo SMS payment gateway

     (1)
    Fortumo sms payment gateway for ClassiPress
  • daddy-likes-190x130
    $19

    Daddy Like

     (10)
    A fast, lightweight, and elegant "like" system for comments, pages, posts, & activities.