WordPress Sitemap Not Working

Short answer

WordPress core has published a sitemap at /wp-sitemap.xml since version 5.5, while Yoast and Rank Math use /sitemap_index.xml and disable the core one. Most WordPress sitemap problems are actually a path mismatch, a deactivated plugin, or a permalink flush that never happened.

Run the Sitemap Checker

Find every sitemap on a site and check it actually works.

Work out which sitemap you are supposed to have

WordPress has three overlapping sources of sitemaps, and knowing which one is in charge resolves most confusion immediately.

Core WordPress has produced a sitemap at /wp-sitemap.xml since version 5.5. It is on by default and requires no plugin.

Yoast SEO produces one at /sitemap_index.xml and switches the core sitemap off, because two sitemaps competing is worse than one. Rank Math does the same at the same path.

So if you are checking /wp-sitemap.xml on a site running Yoast, a 404 is the correct and intended behaviour. You are looking in the wrong place. Read the Sitemap line in your robots.txt to see which one the site is actually declaring.

SourcePathNotes
WordPress core 5.5+/wp-sitemap.xmlOn by default, no plugin needed
Yoast SEO/sitemap_index.xmlDisables the core sitemap
Rank Math/sitemap_index.xmlDisables the core sitemap
All in One SEO/sitemap.xmlConfigurable

The four common causes

In roughly the order we see them.

A path mismatch, covered above: nothing is broken, you are checking a URL that this site does not use.

A deactivated or removed plugin. If a plugin was producing the sitemap and it has been deactivated, that path now 404s, or worse, returns your theme's 404 page with a 200 status. Reinstall it or fall back to the core sitemap.

Permalinks needing a flush. WordPress sitemaps rely on rewrite rules, and those can go stale after a migration or a settings change. Visiting Settings then Permalinks and saving without changing anything regenerates them, which fixes a surprising share of cases.

A caching or security plugin intercepting the request. Some serve a cached HTML page at the sitemap path, or block requests that look automated. Clearing the cache and checking any firewall rules resolves it.

The failure to check for specifically

On WordPress in particular, watch for the sitemap URL returning HTTP 200 with HTML rather than XML.

It happens because a theme's 404 template renders as a normal page, so a missing sitemap path looks like a working page to everything except a parser. Nothing errors, monitoring stays quiet, and the sitemap has been dead since whenever the plugin changed.

View source rather than judging by eye. Valid sitemap XML starts with an XML declaration and contains a urlset or sitemapindex element. Our sitemap checker reports this case distinctly from a 404.

Excluded content is usually deliberate

A frequent complaint is that the WordPress sitemap is missing pages, and the usual reason is that something was configured to exclude them.

SEO plugins let you exclude post types, taxonomies and individual pages from the sitemap, and those settings are easy to forget. Yoast and Rank Math both also exclude anything marked noindex, which is correct behaviour: a page you have told search engines to ignore should not be in the file asking them to crawl it.

So before assuming a bug, check the plugin's sitemap settings and check whether the missing pages are set to noindex. Both are more likely than a genuine fault.

Common questions

Where is the WordPress sitemap?+

Core WordPress publishes one at /wp-sitemap.xml from version 5.5 onwards. Yoast and Rank Math instead use /sitemap_index.xml and disable the core version, so check your robots.txt to see which the site declares.

Why does /wp-sitemap.xml return 404 on my site?+

Most likely because an SEO plugin has disabled the core sitemap and is producing its own at /sitemap_index.xml. That 404 is intended behaviour rather than a fault.

My sitemap loads but is empty or wrong. What now?+

View source and confirm it is really XML rather than an HTML 404 page returned with a 200 status, which is the most common WordPress sitemap failure. If it is valid XML but missing pages, check the plugin's exclusion settings and whether those pages are noindex.

Does resaving permalinks help?+

Often, yes. WordPress sitemaps depend on rewrite rules that can go stale after a migration or settings change. Opening Settings then Permalinks and saving without changes regenerates them.

Should I run two sitemap plugins?+

No. Yoast and Rank Math both disable the core sitemap for good reason: multiple sitemaps competing at different paths creates ambiguity about which one is authoritative.

Sources

A sitemap helps machines find your pages

It does nothing for the visitor who lands on one and cannot find what they came for. A Venbit agent reads your pages and answers them directly, by text or by voice. Free to start, no card.