WordPress – Change Your Feed Links without .htaccess

If you setup feedburner for your blog, then you should redirect your WordPress feeds to the feedburner feed links.

This way you will not lose any subscriber. Normally users do it with a plugin, but you can do it for your client with this function:


function custom_feed_link($output, $feed) {

$feed_url = 'http://feeds.feedburner.com/whileifblog';

$feed_array = array('rss' => $feed_url, 'rss2' => $feed_url, 'atom' => $feed_url, 'rdf' => $feed_url, 'comments_rss2' => '');
$feed_array[$feed] = $feed_url;
$output = $feed_array[$feed];

return $output;
}

function other_feed_links($link) {

$link = 'http://feeds.feedburner.com/whileifblog';
return $link;

}

//Add our functions to the specific filters
add_filter('feed_link','custom_feed_link', 1, 2);
add_filter('category_feed_link', 'other_feed_links');
add_filter('author_feed_link', 'other_feed_links');
add_filter('tag_feed_link','other_feed_links');
add_filter('search_feed_link','other_feed_links');

Leave a Reply

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

*