Ever want to redirect your WordPress blog’s RSS feed to somewhere else – such as FeedBurner?
Go to your site’s root folder to “wp-content > themes > The theme you’re using > functions.php”, and open it in your favorite editor.
Just after the initial php line on Line No. 1 in your functions.php file (of the theme you’re using for your site), paste this code in on Line No. 2:
// CHANGES RSS FEED TO FEEDBURNER FEED LOCATION
function my_rss_link($output, $show)
{
if (in_array($show, array('rss_url', 'rss2_url', 'rss', 'rss2', '')))
$output = 'http://feeds.feedburner.com/yourfeedburnerrsslink';
return $output;
}
add_filter('bloginfo_url', 'my_rss_link', 10, 2);
add_filter('feed_link', 'my_rss_link', 10, 2);
// End Feedburner RSS redirect code
To make the code yours, just replace ‘/yourfeedburnerrsslink’ to the link where your blog’s RSS is housed.
EXAMPLE: Here’s how I configured the code for one of my news websites:
// CHANGES RSS FEED TO FEEDBURNER FEED LOCATION
function my_rss_link($output, $show)
{
if (in_array($show, array('rss_url', 'rss2_url', 'rss', 'rss2', '')))
$output = 'http://feeds.feedburner.com/CitrusTimesOnline';
return $output;
}
add_filter('bloginfo_url', 'my_rss_link', 10, 2);
add_filter('feed_link', 'my_rss_link', 10, 2);
// End Feedburner RSS redirect code
Just replace ‘/CitrusTimesOnline’ to the link where your blog’s RSS lives (such as FeedBurner). Note too, that if you change (or update) the theme you use, you will also have to go into that theme’s functions.php file and make this same change.
You must be logged in to post a comment.