Skip to content

How To Disable Feeds In WordPress

WordPress has its native feed service, so you don’t need to depend on a third-party service, but it’s only helpful for blog sites. If you run another type of website which doesn’t require feeds, you can easily disable feeds in WordPress. Here’s a simple and clean way to do it.

Just drop the following snippet to your current theme’s functions.php file:

unction digwp_disable_feed() {
    wp_die(__('<h1>Feed not available, please visit our <a href="'.get_bloginfo('url').'">Home Page</a>!</h1>'));
}
add_action('do_feed',      'digwp_disable_feed', 1);
add_action('do_feed_rdf',  'digwp_disable_feed', 1);
add_action('do_feed_rss',  'digwp_disable_feed', 1);
add_action('do_feed_rss2', 'digwp_disable_feed', 1);
add_action('do_feed_atom', 'digwp_disable_feed', 1);

Thanks to DigWP for this snippet.

Leave a Reply

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