HostOnNet Blog

How to Disable the Author Page in WordPress

Looking for Linux Server Admin or WordPress Expert? We can help.

To disable the author page from WordPress and redirect using 301 redirection, simply copy and paste the following code into your functions.php file:

 

// Redirect Author Page to Home

function vpsb_redirect_author_page() {
  global $wp_query;
  if ( is_author() ) {
    // Redirect to home, set status to 301 permanent
    wp_redirect(get_option('home'), 301); 
    exit; 
  }
}
add_action('template_redirect', ‘vpsb_redirect_author_page');

If you are using Yoast SEO plugin, you can disable it from admin area > SEO > Search Appearence > Archives > Author archives > Disabled

About Sibi Antony

Bootstrap and Android LOVER. I've been creating things for the web for over 10 years, from the period of flash and table based layout web sites till mobile and tab friendly web sites.
Posted in Wordpress

Leave a Reply

Your email address will not be published. Required fields are marked *

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