941-685-8851

Disable RSS Feed

April 14, 2010 by admin No Comments »

To disable the rss feed and redirect to the home page in wpmu:

Add this code to functions.php

/**
 * Disable Our Feed Urls
 */
function disable_our_feeds() {
 wp_redirect(get_option('siteurl'));
}

add_action('do_feed', 'disable_our_feeds', 1);
add_action('do_feed_rdf', 'disable_our_feeds', 1);
add_action('do_feed_rss', 'disable_our_feeds', 1);
add_action('do_feed_rss2', 'disable_our_feeds', 1);
add_action('do_feed_atom', 'disable_our_feeds', 1);

and/or
open wp-feed.php, wp-rss.php, and wp-rss2.php and change the following line:

wp_redirect( get_bloginfo( 'rss2_url' ), 301 );

to

wp_redirect(get_option('siteurl'));

Another method is to create a folder in the Wordpress root directory called ‘feed’ and post a custom index.php page.  When accessing  feed this page will be displayed instead of a feed.

  • Share/Bookmark
 

Leave a Reply