Snippet: Disable RSS Feed

Add following snippet to “functions.php”

Snippet

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

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>