How to Disable Author Pages in WordPress

WordPress Logo header

I am not a fan of the Author Pages in WordPress. You know, the pages that show everything a single author has published on the site? It’s great if there are more than one author, but if there is only one or two, it is useless.

You can kind of disable Author Pages in WordPress by redirecting those links to the Home page.

  1. Open up your WordPress Admin page, then go to “Appearance” > “Theme Editor“.
  2. Select “Theme Functions (functions.php)” on the right pane.
  3. Add the following snippet of code to the end of the file, then select the “Update File” button.
function redirect_author_page() {
     if ( is_author() ) {
         wp_redirect( home_url() );
         die;
     }
 }
 add_action( 'template_redirect', 'redirect_author_page' );

If you want the author pages to go to a 404 error page instead, use this code:

function redirect_author_page() {
     if ( is_author() ) {
        status_header( 404 );
		nocache_headers();
		include( get_query_template( '404' ) );
        die;
     }
 }
 add_action( 'template_redirect', 'redirect_author_page' );

Mitch Bartlett

I've been doing things on the Internet since 1994. Former dot-com era IT guy. Currently I provide technical solutions to people for fun and test software for a growing software company.

2 thoughts on “How to Disable Author Pages in WordPress

Leave a Reply

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