Ultimate Guide To Redirect WordPress Feed To Feedburner

For those of us using feedburner to handle our WordPress blog feed, have you ever thought of redirecting your default feed to feedburner? though it not a big deal doing this, but in order to take advantage of the feedburner vast feature, don’t you think it is good we maintain just one feed rather than having double feed for our WordPress powered website?
By default, WordPress feed url is usually http://yoursite.com/feed while feedburner is usually http://feeds.feedburner.com/username, but redirecting we are going to redirect the former to the latter.

Using .Htaccess file

The .htaccess is a very important file not only on WordPress but any PHP web application, because it is processed first before any other file or code on your website.
Navigate to your site root folder(where WordPress is installed), open the .htaccess file and add the below lines of code to it.
Note: Always backup file before editing so you can easily restore in case of error


<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} !FeedBurner [NC]
RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC]
RewriteRule ^feed/?([_0-9a-z-] )?/?$ http://feeds.feedburner.com/tech4sky [R=302,NC,L]
</IfModule>

ALTERNATIVELY
in the below code, Googlebot is not redirected to avoid potential sitemap feeds issues. This is important if you using your only if you are using feed as a source of sitemap in Google webmaster tool.


RewriteCond %{HTTP_USER_AGENT} !^.*(FeedBurner|FeedValidator|Googlebot) [NC]
RewriteRule ^/feed/?$ http://feeds.feedburner.com/tech4sky [L,NC,R=302]

NOTE: Change the http://feeds.feedburner.com/tech4sky to your feedburner URL.

Using WordPress Plugin

There are plugins that can handle this feed redirection seamlessly. below are list of plugins and brief description about them as contained in WP repository.

  1. FD Feedburner Plugin – Redirects the main feed and optionally the comments feed to Feedburner.com. It does this seamlessly without the need to modify templates, setup new hidden feeds, modify .htaccess files, or asking users to migrate to a new feed. All existing feeds simply become Feedburner feeds seamlessly and transparently for all users. Just tell the plugin what your Feedburner feed URL is and you’re done.
  2. Primary Feedburner – Redirect visitors to your website feed to feedburner. This will allow you to customize and track your feeds in ways that simply aren’t possible with just WordPress.
  3. FeedBurner FeedSmith Extend – It detects all ways to access your original WordPress feeds and redirects them to your FeedBurner feed. It is enhanced base on the FeedBurner FeedSmith and now it can redirects feeds for category and tag also.

Using Custom Function

If you are the type that hate using plugins just to accomplish a simple task on WordPress, add the below code to your theme function.php and change only http://feeds.feedburner.com/tech4sky/ to your own feedburner URL.


// replace the default posts feed with feedburner
function tech4sky_dot_com_rss_feed( $output, $feed ) {
    if ( strpos( $output, 'comments' ) )
        return $output;

    return esc_url( 'http://feeds.feedburner.com/tech4sky/' );
}
add_action( 'feed_link', 'tech4sky_dot_com_rss_feed', 10, 2 );

If you are using a CMS other than WordPress, here is an apache htaccess code you can use.
Let say the website feed extension is index.xml such that the URL of the feed is https://w3guy.com/index.xml use the below code to redirect the feed to feedburner.


RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} !FeedBurner
RewriteRule ^index\.xml$ http://feeds.feedburner.com/tech4sky [R,L]

NOTE: change index\.xml to your feed extension. note the “\” before the dot(.)

Genesis Theme Framework

If you are using Genesis framework, go to theme settings under Genesis tab. input your feedburner URL in the Enter custom feed URL area. you can also redirect your comment feed(yoursite.com/comments/feed) to it feedburner URL, though this choice is optional. Redirect feed to feedburner - theme settings WordPress

Don’t miss out!
Subscribe to My Newsletter
Invalid email address