Post Pic

How to disable RSS feeds on your WordPress blog

WordPress built-in RSS feeds are definitely cool. But if you’re using WordPress to create a simple website, you may do not need the feeds at all. So what about disabling them? Here’s a simple and clean way to do it.

Paste the code below into your functions.php file. RSS feeds will not be available anymore after you saved the 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 Jeff Starr for the cool tip!

5 Responses

Oct 25 2012 19:51

This will prevent content stealing via rss feed, great!

Oct 26 2012 13:07

This is great thanks for sharing! One small type-o the word “function” is missing an f at the beginning :D

Oct 28 2012 02:13

Alternate title: how to ensure that people don’t read your content.

Nov 04 2012 23:58

@Lutfi, agreed! A great way to keep your content your ‘own’ content.

Jan 02 2013 11:44

ya, i have done it but google is giving me 500 response on all the feed page, how to solve

Trackbacks:

Leave a Comment

* Name, Email, Comment are Required

WP Theme of the week

Sponsored Likebox