How to Disable RSS Feeds in WordPress

How to Disable RSS Feeds in WordPress

RSS (Rich Site Summary or Really Simple Syndication) is a standard XML file format to publish frequently updated information like blog entries, news headlines, audio, video, etc..  An RSS document, called “feed”, “web feed” or “channel”, includes full or summarized text, and metadata, like publishing date, author’s name, image, category, etc… RSS feeds enable publishers to syndicate data automatically.

RSS feeds allow users to subscribe to your blog posts. WordPress website automatically publishes RSS feeds for content and comments. Do you want to disable RSS feeds on your WordPress site? By default, there is no option to remove RSS feeds in WordPress.

Simply add this code to your theme's functions.php file or a site-specific plugin.

function wpb_disable_feed() { 
 wp_die( __('No feed available,please visit our <a href="'. get_bloginfo('url') .'">homepage</a>!') ); 
} 
add_action('do_feed', 'wpb_disable_feed', 1); 
add_action('do_feed_rdf', 'wpb_disable_feed', 1); 
add_action('do_feed_rss', 'wpb_disable_feed', 1);
add_action('do_feed_rss2', 'wpb_disable_feed', 1); 
add_action('do_feed_atom', 'wpb_disable_feed', 1); 
add_action('do_feed_rss2_comments', 'wpb_disable_feed', 1); 
add_action('do_feed_atom_comments', 'wpb_disable_feed', 1);

This code simply returns an error page like this, when someone requests an RSS feed.

WordPress_›_Error

I hope this article helped you learn how to disable RSS feeds in WordPress. If you liked this article, then please subscribe to our newsletter for more tutorials. You can also find me on Twitter and Facebook.