Quick tip; disabling WordPress author pages

I helped build a WordPress-site for a not-for-profit and they asked me to disable the author pages. Although I’m sure there are multiple plugin-based solutions, I ended up simply adding an author.php to my (child) theme with this in it;

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: /");
?>

As author.php is used for all author pages (if available, else archive.php is used), every attempt to reach an author page will result in a permanent redirect being sent, effectively disabling the author archive. Keeping it simple stupid!

12 thoughts on “Quick tip; disabling WordPress author pages

  1. Michael Nordmeyer

    Or you can use WordPress SEO by Yoast, which has an option to disable and redirect author pages.

    But a simple solution is nice, if you don’t want to use the reasonable SEO options to improve your blog.

    Reply
    1. frank Post author

      I often prefer my own simple solutions. Knowing what’s under the hood and all ;-)

      And somehow I feel having author pages should be decided within the theme (or theme settings), not a plugin.

      Reply
      1. Yossi Aharon

        The option is still exist on Yoast. Go to “Titles & Metas”, press on “Archives”, then under “Duplicate content prevention” select the option “Disable the author archives”.

  2. Steve Pringle

    This will work out great for me as I do not want to use Yoast’s plugin. For one, it is in conflict with 3 plugins I already use (because of similar features) and two, I can not control the canonical on my site due to it. The site has an SSL certificate and loads with the https protocol but I want SE’s to index the non-https version of the site since I may may drop the SSL feature in the future and Yoast’s plugin keeps setting the canonical to the https so I had to drop it altogether.

    Reply
  3. Jameson Williams

    Frank — good tip. I actually want to just generate a 404 page (the same one that’s already in my theme) so I used your approach of introducing author.php, but mine reads:

    Reply
  4. ahmed

    hiding the author URL that well get you 404 error ? if it s indexed is that gonna hurt you rank ?
    if yes how to show them
    thanks

    Reply

Leave a Reply

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