How to Disable RSS Feeds in WordPress

How to Disable RSS Feeds in WordPress

RSS stands for Rich Site Summary or Really Simple Syndication and feeds the latest status or blog updates from one site into another in a standardized form. It allows users to keep track of their favorite websites without having to manually visit the website each time, and allows publishers to syndicate their contents automatically.

WordPress automatically generates RSS feeds, but you can change them to make them even more useful. Alternately, you can disable them if you prefer. You can use the WordPress plugin Disable Feeds or you can disable them by creating a function in WordPress.

For this you need to open your functions.php which is located within your themes folder and add the following code:


function fb_disable_feed() {
wp_die( __('No feed available,please visit our <a href="'. get_bloginfo('url') .'">homepage</a>!') );

add_action('do_feed', 'fb_disable_feed', 1);
add_action('do_feed_rdf', 'fb_disable_feed', 1);
add_action('do_feed_rss', 'fb_disable_feed', 1);
add_action('do_feed_rss2', 'fb_disable_feed', 1);
add_action('do_feed_atom', 'fb_disable_feed', 1);
add_action('do_feed_rss2_comments', 'fb_disable_feed', 1);
add_action('do_feed_atom_comments', 'fb_disable_feed', 1);

After adding the code, no one will be able to reach your feeds and they will get the message “No feed available, please visit our homepage.” You can also change the message that is displayed, if you prefer.


Community-based and focused on all things WordPress!

Leave a Reply

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

How to Disable RSS Feeds in WordPress

by WPSolution time to read: 1 min