Performance & Security

Disable WordPress Author Archives Without a Plugin

If you run a single author WordPress site, author archive pages usually add nothing for your readers. Each archive repeats posts that already appear on your blog index, and the URL also exposes the username behind your login. This guide shows you how to disable WordPress author archives without a plugin, using small code snippets that you can remove at any time. You will redirect or block the archive pages, stop the author ID lookup that reveals usernames, remove author pages from the XML sitemap, and test everything before you call it done.

Before you add any code, take a full backup and test on a staging copy if you have one. The snippets belong in a child theme functions.php file or a small site specific plugin, never in a parent theme that updates will overwrite.

What are WordPress author archives?

An author archive is an automatic listing page that WordPress creates for every user who has published content. It lives at a predictable URL built from the username, such as yoursite.com/author/yourname/. The page lists every post by that author, usually with the same layout, excerpts, and pagination as your main blog index.

Author archives make sense on multi author publications where readers follow individual writers. On a site where one person writes everything, the archive is a near copy of the blog page, with the same posts in the same order and no unique introduction.

Why should you disable author archives?

Do author archives create duplicate content on single author sites?

Yes, and that duplication is the main reason to switch them off. Search engines must crawl and index an extra set of listing pages that mirror your blog index and category pages. The archive competes with your real blog page for the same queries, splits internal link signals, and burns crawl budget on pages with no unique value. Removing the archive lets your blog index and category pages carry that weight instead.

Can author archives expose your login username?

They can. WordPress builds the archive URL from the account username, so the slug in /author/yourname/ is the exact name typed at the login screen. Worse, anyone can request yoursite.com/?author=1 and WordPress redirects the browser to the archive of user ID 1, which is usually the site administrator. That redirect hands attackers half of your login credentials before they guess a single password. If your username is still the predictable default, change your WordPress username first, then block the enumeration path with Method 2 below.

Are author archives thin content?

On most small sites, yes. The page holds a title, a list of excerpts, and little else. Search engines treat large numbers of thin listing pages as a low quality signal. Disabling them keeps your index focused on pages you actually want to rank.

How do you disable author archives without a plugin?

Method 1 is the core fix and is enough for most sites. Method 2 closes the username lookup that Method 1 alone can miss. Method 3 does the same job at server level for Apache hosts. After the redirects, one short filter removes author pages from the core XML sitemap so search engines stop discovering them.

Method 1: How do you redirect author archives with template_redirect?

The cleanest approach hooks into template_redirect, the action WordPress fires just before it chooses a template. The is_author() check confirms the visitor asked for an author archive, and then you send them somewhere useful with a permanent 301 redirect.

add_action( 'template_redirect', 'vutg_disable_author_archives' );
function vutg_disable_author_archives() {
    if ( is_author() ) {
        wp_safe_redirect( home_url( '/' ), 301 );
        exit;
    }
}

Point the redirect at your homepage, or better, at your blog index if it lives on its own page. A blog page is the closest match for what the visitor expected, so swap home_url( ‘/’ ) for home_url( ‘/blog/’ ) when your posts page uses that slug. A 301 tells search engines the archive is gone for good and passes any accumulated signals to the destination.

Choose a 404 response instead when the archives were never linked, never indexed, and carry no traffic worth saving. A 404 states plainly that the page does not exist, and search engines drop it from the index without treating your homepage as a replacement. The 404 variant looks like this.

add_action( 'template_redirect', 'vutg_disable_author_archives' );
function vutg_disable_author_archives() {
    if ( is_author() ) {
        global $wp_query;
        $wp_query->set_404();
        status_header( 404 );
        nocache_headers();
    }
}

Most single author sites should start with the 301 version, since it protects old bookmarks and backlinks. Pick the 404 version only when nothing valuable links to those URLs.

Method 2: How do you block the ?author=ID username lookup?

Redirecting the archive itself is not the whole story. The ?author=1 request reveals the username during the redirect, before your archive redirect ever runs. Block numeric author queries early, at priority 1, so the lookup dies before WordPress can answer it with a username.

add_action( 'template_redirect', 'vutg_block_author_enumeration', 1 );
function vutg_block_author_enumeration() {
    if ( isset( $_GET['author'] ) && is_numeric( $_GET['author'] ) ) {
        wp_safe_redirect( home_url( '/' ), 301 );
        exit;
    }
}

Keep in mind that usernames can still leak through other doors. The REST API users endpoint lists author slugs on many sites, and oEmbed responses include author names too. If hardening is your goal, pair this snippet with our guide to disable the WordPress REST API without a plugin, or at least restrict its users endpoint.

Method 3: How do you block author archives in .htaccess?

On Apache servers you can stop author requests before WordPress even loads. Add these rules near the top of your .htaccess file, above the BEGIN WordPress block, so WordPress rewrite rules cannot override them. Back up the file first, because a typo here can take the whole site offline.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} (^|&)author=\d+ [NC]
RewriteRule ^$ / [R=301,L]
RewriteRule ^author/.*$ / [R=301,L]
</IfModule>

The first rule catches the numeric ?author=ID lookup on the homepage, and the second sends every /author/ URL to the homepage with a 301. This method suits sites where you prefer server level control or where a theme change might remove your PHP snippet. It only works on Apache and LiteSpeed. Nginx hosts need equivalent rules in the server block, which usually means asking your host or using Method 1 instead. Avoid running both the .htaccess rules and the PHP redirect at once, since double redirects slow the response and confuse testing.

How do you remove authors from the XML sitemap?

Redirects alone leave one loose end. The core WordPress sitemap includes a users sitemap that lists author archive URLs for everyone with published posts. Submitting URLs that only redirect wastes crawl attention and can trigger redirect warnings in Search Console. Remove the users provider with the wp_sitemaps_add_provider filter.

add_filter( 'wp_sitemaps_add_provider', 'vutg_remove_user_sitemap', 10, 2 );
function vutg_remove_user_sitemap( $provider, $name ) {
    if ( 'users' === $name ) {
        return false;
    }
    return $provider;
}

After adding the filter, open your sitemap index at yoursite.com/wp-sitemap.xml and confirm the users sitemap is gone. If you use an SEO plugin sitemap instead of the core one, the plugin settings in the next section control the same behaviour.

Can an SEO plugin disable author archives instead?

Yes, and it takes seconds if you already run one. In Yoast SEO, open Settings, find the Advanced section, and switch off author archives. In Rank Math, open Titles and Meta, choose Authors, and disable the author archives or set them to noindex. Both plugins also drop authors from their sitemaps. The code methods here do the same job and keep working if you ever change SEO plugins.

What should multi author sites do instead?

Do not disable archives outright when several writers publish and readers browse by author. A magazine or team blog gains real value from author pages, especially when each page carries a biography, photo, and social links. The smarter move there is to noindex thin archives while keeping the pages live for visitors. This snippet adds a noindex directive to author archives only.

add_filter( 'wp_robots', 'vutg_noindex_author_archives' );
function vutg_noindex_author_archives( $robots ) {
    if ( is_author() ) {
        $robots['noindex'] = true;
    }
    return $robots;
}

Use noindex when archives help readers but add little search value. Use the full redirect when one author writes everything and the archive only mirrors the blog index.

How do you test that author archives are disabled?

Work through this checklist in a private browser window so caching cannot fool you.

  • Visit yoursite.com/author/yourname/ and confirm you land on the homepage or blog page, or see your 404 page if you chose that variant.
  • Visit yoursite.com/?author=1 and confirm the browser never shows a URL containing your username.
  • Open yoursite.com/wp-sitemap.xml and confirm no users sitemap is listed.
  • Open your blog index and one normal post to confirm regular pages still load and paginate correctly.
  • Search your menus, widgets, and footer for links to author archives and remove or retarget them.
  • Watch Search Console coverage over the next few weeks as the old archive URLs drop out of the index.

One point catches people out. Disabling the archive does not remove the byline or author box from your posts. The name under each title comes from your theme, not from the archive page. If you want to control that area too, our guide on how to add an author box in WordPress shows how to style or replace it.

How do you undo this change?

Remove the snippets from your child theme or site specific plugin, delete the .htaccess rules if you added them, and restore your backup copy of that file if you kept one. Then visit Settings, open Permalinks, and click Save Changes to flush the rewrite rules. Author archives and the users sitemap return immediately. If you are trimming other default features while you are here, you can also disable WordPress search without a plugin using a similar approach.

Frequently Asked Questions

Will disabling author archives hurt my SEO?

On a single author site it usually helps, because crawl budget and internal links concentrate on your blog index and category pages instead of duplicate listings. If an author archive somehow earns real traffic or backlinks, keep the 301 redirect so that value flows to your blog page.

Does disabling archives hide my username everywhere?

No. The archive slug and the ?author=ID lookup stop revealing it, but bylines, the REST API users endpoint, oEmbed data, and RSS feeds can still expose author names. Treat this change as one layer. Use a username that differs from your display name, restrict the REST users endpoint, and protect the login page with strong passwords and two factor authentication.

Should I use a 301 redirect or a 404 response?

Use a 301 redirect to your blog page when the archives are indexed, linked, or bookmarked, since it preserves visitors and signals. Use a 404 when the archives were never promoted and you want search engines to drop them cleanly. Both options remove the pages. The redirect is the safer default for established sites.

Can I bring author archives back later?

Yes. Delete the code snippets, remove any .htaccess rules you added, and save your permalink settings once to flush rewrite rules. The archives, the ?author=ID lookup, and the users sitemap all return. Nothing in this process deletes users or posts, so the change is fully reversible.

Last updated: December 2026.

Hostinger - Get 20% OFF

Habib ur Rehman

Hello! I'm the founder of VU Tech Geek. As a BSCS graduate and experienced WordPress professional, I'm passionate about technology and education. My Virtual University journey has given me valuable insights and knowledge, which I love to share with fellow students.… More »

Related Articles

Leave a Reply

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

Back to top button

Adblock Detected

Please consider supporting us by disabling your ad blocker