How Redirect WordPress Feeds to Feedburner

I have been guilty of using a plugin for it in the past, but it simply isn’t necessary, with this small code snippet you can easily achieve the same results without loading a plugin.

 * Redirect WordPress Feeds to Feedburner
if ( ! function_exists( 'ns_rss_redirect' ) ) {
function ns_rss_redirect() {
 if ( is_feed() && ! preg_match( '/feedburner|feedvalidator/i', $_SERVER[ 'HTTP_USER_AGENT' ] ) ){
  header( 'Location:' );
  header( 'HTTP/1.1 302 Temporary Redirect' );

add_action( 'template_redirect', 'ns_rss_redirect' );

Obviously, you should replace “your feed name” with your Feedburner feed name.

source: 10 Tips optimize WordPress theme



I am a Freelance Web Developer and WordPress Expert based in London with a wealth of website development and support experience. I am great at problem solving and developing quick solutions.


    Fill in the form below to make an enquiry or find my contact details on my contact page.