Skip to content

Instantly share code, notes, and snippets.

@hauge75
Last active April 11, 2016 23:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hauge75/0dda5b75d1288bb4259f28a783eae115 to your computer and use it in GitHub Desktop.
Save hauge75/0dda5b75d1288bb4259f28a783eae115 to your computer and use it in GitHub Desktop.
Redirects wordpress author archives
<?php
//Redirects author archives, DON'T check "Disable Extra User Archives" in iThemes security
add_action( 'template_redirect', 'my_redirect_author_archive' );
function my_redirect_author_archive() {
if ( is_author() ) {
wp_redirect( home_url(), 302 );
exit;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment