Duplicate XML sitemaps: when wp-sitemap.xml and a plugin sitemap are both live
WordPress has generated its own sitemap at /wp-sitemap.xml since version 5.5, and most SEO plugins generate another. If both are live, or an old static sitemap.xml is still in the site root, search engines receive overlapping URL lists that can disagree. Keep the one that follows your indexing settings and switch off the rest.
Having two sitemaps is not an error in the protocol. The trouble starts when they list different URLs, because only one of them reflects what you actually want indexed.
Take an inventory
Request each of the usual addresses and note what comes back:
for p in sitemap.xml sitemap_index.xml wp-sitemap.xml sitemap.xml.gz; do
curl -s -o /dev/null -w "$p %{http_code} %{redirect_url}\n" "https://example.com/$p"
done
curl -s https://example.com/robots.txt | grep -i "^sitemap"
Then check three more places:
- Search Console → Indexing → Sitemaps. Every address ever submitted is listed, including ones from previous plugins.
- The site root over SFTP. A physical
sitemap.xmlfile is served by the web server before WordPress loads, so it overrides any plugin sitemap at the same address. - Bing Webmaster Tools, if you use it, which keeps its own list.
A 200 from more than one address, or more than one Sitemap: line in robots.txt, confirms the duplication.
How the lists drift apart
The WordPress core sitemap is deliberately simple. It lists public posts, pages, custom post types, taxonomy terms and author archives, up to 2,000 URLs per file. It does not read SEO plugin settings, so a page you noindexed in a plugin is still listed there, as are author archives you may have chosen not to index.
A plugin sitemap built from your SEO settings leaves those out. Submit both and Google is told to index a URL by one file and not by the other, which produces noindexed URLs in the sitemap and muddies the submitted-page counts.
A static file is worse because it is frozen at the day it was generated: deleted pages stay in it and new ones never appear.
Keep one, remove the others
- Choose the sitemap that respects your noindex and canonical settings. With Hydrogen SEO active, that is its index at
/sitemap.xml. The plugin switches the core sitemap off and redirects/wp-sitemap.xmlto its own index, so old links and submissions to the core address still resolve. Nothing else is needed for the core sitemap. - If you are not using a plugin sitemap, the core one is fine on its own. To turn core's off manually when another generator is in charge, add
add_filter( 'wp_sitemaps_enabled', '__return_false' );to a small plugin or the theme'sfunctions.php. - Delete static files. Remove
sitemap.xml,sitemap.xml.gzand similar files from the site root after confirming they are not what your plugin serves. A dynamic sitemap has no file on disk. - Deactivate leftover generators. A standalone sitemap plugin left active after an SEO plugin was installed is a common source. Running two SEO plugins at once duplicates meta tags too; see fixing duplicate meta output.
- Clean robots.txt. It should contain one
Sitemap:line, pointing at the index you kept. Hydrogen SEO adds its own line automatically; remove hand-written ones for retired addresses. A physical robots.txt file must be edited by hand. - Clean Search Console. In the Sitemaps report, open each obsolete entry and choose Remove sitemap, then submit the surviving index once.
Multiple sitemaps that are fine
Do not merge sitemaps that cover different things. A sitemap index with child sitemaps per post type is one sitemap, not many. Separate news and video sitemaps are meant to sit alongside the main one. A multilingual site may have one index per language, and a site with a blog on a subdomain needs a sitemap per host. The problem this page describes is two generators describing the same pages.
Check the result
Run the inventory loop again. One address should return 200 and the others a redirect to it or a 404. robots.txt should show a single Sitemap: line. Validate the surviving file with our XML sitemap validator, and run the free SEO audit, which reads the sitemap named in robots.txt and reports whether it parses and how many URLs it lists.
Common questions
Does Google penalise duplicate sitemaps?
No. The risk is inconsistency: URLs you excluded from one sitemap being submitted by another, and reports that are harder to read.
Is the WordPress core sitemap good enough on its own?
For a simple site, yes. It lacks image entries and does not follow SEO plugin noindex settings, which is why sites using an SEO plugin normally use the plugin's sitemap.
I removed an old sitemap from Search Console. Will its URLs be deindexed?
No. Removing a sitemap entry only stops Google reading that file. Indexed pages are unaffected.
Why does /sitemap.xml show old content even though my plugin is active?
A physical file with that name in the site root is probably being served instead of the plugin's output. Delete it and reload.