An easy Hack to Disable RSS feeds in WordPress


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.

1 comment on this postSubmit yours
  1. Does Not Work.

    anything else to try?

1 pingback on this post
Submit your comment

Please enter your name

Your name is required

Please enter a valid email address

An email address is required

Please enter your message

Design Gala © 2012 All Rights Reserved

Developed by 76 Miles

Powered by WordPress