An easy Hack to Disable RSS feeds in WordPress

November 7, 2009 |  by Anish Blon
67529bc2b7f24298ada4c75c6053cb92 Del.icio.us

disable rss wordpressRSS feed is one of the best feature of WordPress for sharing post. But there are cases where feeds either have little importantce or does not have any roles to play as in static websites, CMS. For all who do not need RSS feature in WordPress it can be disabled with a little effort.

Step 1:

Create a new function in function.php located in your active theme folder like below:

/**
* disable RSS feed
*/
function wp_disable_feed() {
   wp_die( __('Sorry, no feeds available, return to <a href="'. get_bloginfo('url') .'">homepage</a>') );
}
 
add_action('do_feed', 'wp_disable_feed', 1);
add_action('do_feed_rdf', 'wp_disable_feed', 1);
add_action('do_feed_rss', 'wp_disable_feed', 1);
add_action('do_feed_rss2', 'wp_disable_feed', 1);
add_action('do_feed_atom', 'wp_disable_feed', 1);

I told you. Its very easy to disable feeds.


No Comments


Trackbacks

  1. Design Gala

Leave a Reply