Last active
December 23, 2015 01:59
-
-
Save cristovaov/10c57740cf372f808fb8 to your computer and use it in GitHub Desktop.
Simple Feed disabler & redirect for WordPress
-- snippet to add to your function file
---- see logbook for info/instructions http://wp.me/pKmdR-p8
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 and redirect feed links snippet | |
by Cristovao Verstraeten - apleasantview.com 2013*/ | |
function simple_nofeed() { | |
remove_action( 'wp_head', 'feed_links', 2 ); | |
remove_action( 'wp_head', 'feed_links_extra', 3 ); | |
if ( is_feed() ) | |
{ | |
status_header( '404' ); | |
locate_template( array ( '404.php', 'index.php' ), TRUE, TRUE ); | |
exit; | |
} | |
} | |
add_action( 'template_redirect', 'simple_nofeed' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment