How To Disable Author Archive Pages Without A Plugin

Development 2 min read

WordPress has a lot of cool archives built into the default system. For example, the following each have their own archive:

  • Each Taxonomy
  • Search
  • Author Archives

For single author websites, author archives do not do much good; as they will look just like the homepage. I will note, author archives can be disabled in Yoast SEO, and there may be a more efficient way of doing this, but this is what has worked for me.

/* Disable Author Pages (Archives) */
function sertmedia_disable_author_archives() { if (is_author()) { global $wp_query; $wp_query->set_404(); status_header(404); } else { redirect_canonical(); } } remove_filter('template_redirect', 'redirect_canonical'); add_action('template_redirect', 'sertmedia_disable_author_archives');

This isn't the largest snippet and it's quite efficient. Essentially, if you are on an author page then it will return a 404. This is a quick fix to remove pages without having to implement meaningless redirects. This can be added to the following places:

  • functions.php file of a child theme

You can change this code to do a 301 redirect to your homepage or any number of things, but this is a quick and simple way to disable author archive pages without a plugin.

Do you have any questions about this implementation? If you need assistance or have a question feel free to ask me in the comments below and I will make sure to get back to you!

Scott Hartley

Scott Hartley

Founder & CEO, Sert Media

Founder and CEO of Sert Media, a Nashville-based digital marketing agency. Scott has spent over 15 years helping businesses grow through SEO, web performance optimization, and strategic digital marketing. His deep expertise in WordPress development, site speed, and technical SEO has guided hundreds of brands toward measurable results. When he's not auditing Core Web Vitals or refining campaign strategies, he's writing about the tools, techniques, and trends shaping the modern web.

Leave a Comment

Your email address will not be published. Required fields are marked with an asterisk.

Related Articles