Created
May 9, 2016 09:06
-
-
Save veganista/c519b0b1123c82a399efa53adaf83fcf to your computer and use it in GitHub Desktop.
Disable author pages in WordPress
This file contains hidden or 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 author pages | |
*/ | |
add_action( 'template_redirect', function(){ | |
global $wp_query; | |
if ( is_author() && !is_404() ) { | |
$wp_query->set_404(); | |
status_header( 404 ); | |
nocache_headers(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment