Skip to content

Instantly share code, notes, and snippets.

@jaredatch
Forked from ramseyp/wp-disable-feeds.php
Created November 15, 2012 17:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredatch/4079944 to your computer and use it in GitHub Desktop.
Save jaredatch/4079944 to your computer and use it in GitHub Desktop.
Disable Feeds for WordPress site
<?php
/**
* Disable feeds
*
* @return string die
*/
function ja_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 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment