How to remove author pages from the WordPress sitemap
WordPress's built-in sitemap includes a users sitemap at /wp-sitemap-users-1.xml that lists the author archive of every user with a published post. To remove it, return false from the wp_sitemaps_add_provider filter for the users provider. Hydrogen SEO's own sitemap has no author sitemap, so with the plugin active there is nothing to remove.
Author archives are worth listing on a publication with real author profiles. On a business site with one or two logins they list the same posts as the blog page, and the users sitemap mainly advertises account names.
Step by step
1. See what your sitemap lists today
Open https://example.com/wp-sitemap.xml. On a site using the core sitemap you will see an index with entries for posts, pages, taxonomies and, if any user has published content, wp-sitemap-users-1.xml. Open that file: each <loc> is an author archive such as /author/wpadmin84/. If your sitemap index lives at /sitemap.xml instead, an SEO plugin is providing it and the core one is switched off.
2. Remove the users provider
Core registers three sitemap providers: posts, taxonomies and users. Each passes through a filter before it is added, and anything that is not a provider object is discarded. Add this to a small plugin or your child theme's functions.php:
add_filter( 'wp_sitemaps_add_provider', function ( $provider, $name ) {
if ( 'users' === $name ) {
return false;
}
return $provider;
}, 10, 2 );
Core sitemaps are generated on request and not stored, so the change applies on the next load.
3. Check the index
Reload /wp-sitemap.xml. The users entry should be gone, and /wp-sitemap-users-1.xml should return a 404. If the entry is still listed, a page cache is serving the old XML, or the snippet is in a file that is not loading. Purge the cache and confirm the code is in the active theme.
4. Or keep the sitemap and trim who is listed
If some authors deserve a listing and others do not, filter the user query instead of removing the provider. Core builds the list with has_published_posts, and you can add an exclusion:
add_filter( 'wp_sitemaps_users_query_args', function ( $args ) {
$args['exclude'] = array( 1, 14 ); // user IDs to leave out
return $args;
} );
User IDs are in the address bar of each profile's edit screen as user_id=14.
5. Decide what happens to the archives themselves
Removing a URL from a sitemap does not remove it from search. Author archives remain crawlable through the author links on your posts. Decide separately whether they should be indexed:
- With Hydrogen SEO: author archives are set to No index by default under Hydrogen SEO → Titles & Meta → Archives. Choose Index for a multi-author publication, or Disabled to 301-redirect every author URL to the homepage.
- Without a plugin: core has no setting. A
wp_robotsfilter that adds noindex whenis_author()is true does it in code.
Sitemap and robots settings should agree: listed and indexable, or unlisted and noindex.
6. Using Hydrogen SEO's sitemap instead
When the plugin's XML sitemap is on, it switches the core sitemap off and redirects /wp-sitemap.xml to /sitemap.xml. Its index contains post type and taxonomy sitemaps, plus the optional video and news sitemaps. Author archives are not part of it, and the filter above is not needed. Check Hydrogen SEO → Sitemap → View Sitemap to see exactly what is listed.
7. Update Search Console if you had submitted it
If wp-sitemap-users-1.xml was submitted on its own under Sitemaps in Search Console, remove that entry, since it now returns 404. If you only submitted the index, there is nothing to do.
Does the users sitemap expose usernames
It lists author archive URLs, and by default the last part of each is derived from the login name. That is public anyway through author links on posts, so removing the sitemap is tidiness, not a security measure. If the login name in the URL bothers you, change the author slug; see change the author URL base.
Mistakes to avoid
- Disabling the whole core sitemap with
wp_sitemaps_enabledwhen you only meant to drop authors. Posts and pages go with it. - Blocking
/author/in robots.txt to "hide" the pages. Blocked URLs can still be indexed from links, without a description. - Removing the sitemap while author archives stay indexable and thin. The sitemap was not the problem. The archives are.
Common questions
Why are authors in my WordPress sitemap?
The built-in sitemap added in WordPress 5.5 includes a users provider, which lists the archive page of each user who has published content.
Is the filter needed with an SEO plugin?
Usually not. Most replace the core sitemap with their own. Hydrogen SEO's sitemap does not include author archives at all.
Will removing authors from the sitemap deindex their pages?
No. It only stops listing them. Add noindex, or disable the archives, if you want them out of search results.