Disable Author Pages

To disable author pages then redirect page visitors to homepage, down below a little snippet code that you may add to functions.php

/**
 * Disable Author Pages
 */
function disable_author_pages() {
    global $wp_query;
    if ( is_author() ) {
      wp_redirect( get_bloginfo( 'wpurl' ), 301 );
      exit;
    }
}
add_action( 'template_redirect', 'disable_author_pages', 1 );

Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.