How to use FeedBurner with WordPress

Find out how to use FeedBurner with WordPress. If you have a blog, you’re probably familiar with the concept of feeds. If you’re not sure what a feed is, read my article about RSS feeds. Feeds are a great way to share content. However, there are some limitations. There’s really no way to know any stats on subscribers. How can it be done? FeedBurner, now owned by Google, is a popular syndication service that makes it easy to receive content updates in news readers. Though it is free, you get what you pay for in support.

FeedBurner

Benefits of using FeedBurner

Okay, so you have a self-hosted WordPress site with a feed. Do you know how many subscribers your feed has? No. There’s no way to tell if anyone is subscribed or not. FeedBurner allows publishers who already have a feed to improve their understanding of and relationship with their audience by offering customization and feed management tools. These tools allow you to see exactly how many subscribers you have. Now you have another way to gauge which part of your site’s content is most relevant to your readers.

Aside from statistics, FeedBurner also provides many options for feed optimization, and feed publication.

FeedBurner with WordPress

One thing to keep in mind when using FeedBurner with WordPress is that you must make sure to unify your feed. In order for everyone to receive the same feed, your old feed must be redirected to the new. There are three ways to do this.

1. Edit .htaccess

You can add the redirects to the .htaccess file on your server if you’re comfortable editing important system files. Make sure to backup .htaccess in case anything goes wrong. Here is an example of code you can use to redirect your main feed as well as your comments feed.

# Redirect RSS feeds to FeedBurner
<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{REQUEST_URI}      ^/?(feed.*|comments.*)        [NC]
 RewriteCond %{HTTP_USER_AGENT} !^.*(FeedBurner|FeedValidator) [NC] 
 RewriteRule ^feed/?.*$          http://feeds.feedburner.com/YourFeedName         [L,NC,R=302]
 RewriteRule ^comments/?.*$      http://feeds.feedburner.com/YourFeedName-Comments [L,NC,R=302]
</IfModule>

Make sure to change “YourFeedName” to the actual name of your feed.

2. Edit functions.php

Or, you could customize your theme’s functions.php file. The following code redirects your main feed. It can be placed in functions.php anywhere after the initial php tag as long as it’s not inside another function.

// Redirect RSS feed to FeedBurner //
function rss_feed_redirect() {
    global $feed;
    $new_feed = 'http://feeds.feedburner.com/YourFeedName';
    if (!is_feed()) {
            return;
    }
    if (preg_match('/feedburner/i', $_SERVER['HTTP_USER_AGENT'])){
            return;
    }
    if ($feed != 'comments-rss2') {
            if (function_exists('status_header')) status_header( 302 );
            header("Location:" . $new_feed);
            header("HTTP/1.1 302 Temporary Redirect");
            exit();
    }
}
add_action('template_redirect', 'rss_feed_redirect');

Again, make sure to change “YourFeedName” to the actual name of your feed.

3. Use a Plugin

If you’d like a simpler solution, let a plugin do the heavy lifting for you. There are many WordPress Plugins to choose from, but here are a few of the most popular.

How to Notify Your Readers

As far as I can tell, when switching from a native WordPress feed to a FeedBurner feed, your current subscribers will have to re-subscribe to the new feed. So, it’s a great idea to make a post that informs them about the upcoming feed switch before you actually change them. That way, they will know why your feed isn’t updated anymore. Furthermore, they’ll have a link to the new feed.

This solution is far from perfect, but it should make it easier for them to subscribe to your new feed. If anyone knows how to avoid this problem, or if it’s even possible, please add a comment below. Thanks.

Subscribe to my Feeds:

Middle Ear Media Article Feed via RSS

Middle Ear Media Comment Feed via RSS


Comments

One response to “How to use FeedBurner with WordPress”

  1. FeedBurner also gives you the option to easily submit to feeds via email.

Leave a Reply

Your email address will not be published. Required fields are marked *