Leave tags and authors out of the sitemap
WordPress’s built-in sitemap (/wp-sitemap.xml) lists your posts, pages and categories, but not tag archives or author pages.
<?php
add_filter(
'wp_sitemaps_taxonomies',
static function ( $taxonomies ) {
unset( $taxonomies['post_tag'] );
return $taxonomies;
}
);
add_filter(
'wp_sitemaps_add_provider',
static fn( $provider, $name ) => 'users' === $name ? false : $provider,
10,
2
);
In these packs
- SEO basics: Meta descriptions, social sharing tags, article structured data and cleaner indexing, for sites without an SEO plugin.