How Redirect WordPress Feeds to Feedburner

 In RSS Feeds

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 .

add_action('template_redirect', 'ns_rss_redirect');
function ns_rss_redirect() {

 if ( is_feed() && !preg_match('/feedburner|feedvalidator/i', $_SERVER['HTTP_USER_AGENT'])){
  header('Location: http://feeds.feedburner.com/yourfeedname');
  header('HTTP/1.1 302 Temporary Redirect');
 }

}

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

How may need this function that allows to included thumbnail on rss feed –  Nuno Sarmento – click @  https://www.wp-code.uk for the code snippet.

source: 10 Tips optimize WordPress theme

Recommended Posts

Start typing and press Enter to search