Skip to content

Instantly share code, notes, and snippets.

@ethangardner
Created September 21, 2011 17:31
Show Gist options
  • Save ethangardner/1232740 to your computer and use it in GitHub Desktop.
Save ethangardner/1232740 to your computer and use it in GitHub Desktop.
Disables Wordpress RSS feeds
/**
* Disable RSS feeds for Wordpress
*/
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);
function remove_comments_rss( $for_comments ) {
return;
}
add_filter('post_comments_feed_link','remove_comments_rss');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment