Created
March 17, 2012 04:15
-
-
Save yoren/2054890 to your computer and use it in GitHub Desktop.
WordPress: Disable Feed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* disable feed | |
* @link http://wpengineer.com/287/disable-wordpress-feed/ | |
*/ | |
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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment