How to Disable RSS Feeds in WordPress Without Plugin
Some small business owners use WordPress as CMS. They do not need any sort of RSS feed. This is also good for security and private space blogs. You can easily disable all RSS feed.
Click on Appearance > Themes > Theme Editor > Locate and edit your functions.php.
Fig.01: WordPress Themes Editor
Append following php code:
/*
Disable Our Feed Urls
alihan.com.tr */
function disable_our_feeds() {
wp_die( __('<strong>Error:</strong>Sorry! No RSS Feed Available, Please visit our <a href="'. get_bloginfo('url') .'">homepage</a>. Thanks!') );
}
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);
Save the changes.
( Ali Han, URI:alihan.com.tr/blog )
How to Disable RSS Feeds in WordPress Without Plugin WordPress Theme
Reviewed by Ali Han on November 4th 2010
Rating:


