AussieDave
24 years & still going!
- Joined
- Nov 28, 2013
- Messages
- 5,103
- Reaction score
- 3,607
One way scrapers and other undesirables can gain easy access to your blog content is via your WP rss and comment feeds. While you can remove your RSS links in your WP header and on-site links, these do not stop your WP site producing feeds from you blog posts.
To totally disable WP producing RSS feeds, you need to add the following php code to you theme's functions.php file.
I placed this code directly under the RSS comment tag in my theme's functions.php file.
From now on my RSS feed is totally disable. Another hole blocked to anyone or anything using my RSS feed to obtain my content.
To totally disable WP producing RSS feeds, you need to add the following php code to you theme's functions.php file.
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);
I placed this code directly under the RSS comment tag in my theme's functions.php file.
From now on my RSS feed is totally disable. Another hole blocked to anyone or anything using my RSS feed to obtain my content.