Find out which sitemap URL you are testing, then work outward. Core WordPress serves /wp-sitemap.xml. A plugin may replace it with its own URL and turn the core one off. If the URL that should exist returns 404, check in this order: Site Visibility, the plugin filter that disables core sitemaps, a permalinks flush, then server rewrite rules.
Symptom to cause
| Symptom | Cause | Fix |
|---|---|---|
| Every pretty URL 404s, not only the sitemap | Stale or missing rewrite rules | Settings, Permalinks, Save Changes |
/wp-sitemap.xml 404s, plugin sitemap works | Plugin replaced the core sitemap | Submit the plugin's URL instead |
| Both sitemaps 404 on a new site | Discourage search engines is ticked | Settings, Reading, untick it |
| Sitemap 404 after a plugin was deactivated | Permalinks plain, or leftover rule | Enable pretty permalinks and flush |
Only .xml files 404 | Server config handles .xml before WordPress | Fix the rewrite or location rule |
| Sitemap 404 for logged-out visitors only | Cache, firewall or maintenance plugin | Test in a private window; purge cache |
The request path
Check one: which sitemap should exist?
Open /robots.txt. WordPress adds a sitemap line automatically for the core sitemap, and SEO plugins add theirs. The URL listed there is the one that should answer with 200. Then run it through the sitemap checker, or from a terminal:
curl -sI https://example.com/wp-sitemap.xml | head -n 1
curl -sI https://example.com/sitemap_index.xml | head -n 1
Check two: visibility and plugin filters
WordPress core documentation says sitemaps are disabled when Site Visibility is set to discourage search engines. It also says the wp_sitemaps_enabled filter can override the default. A plugin or custom code returning false from that filter turns the core sitemap off. To test, deactivate plugins one group at a time, and reload the URL after each. Search your theme or an mu-plugin for the filter name:
grep -R "wp_sitemaps_enabled" wp-content/ --include=*.php
Check three: flush permalinks
Go to Settings, Permalinks and click Save Changes without altering anything. That regenerates the rewrite rules. If your permalink setting is Plain, switch to a named structure; a core contributor advised that pretty permalinks be enabled in a related plugin case. Plain permalinks may not route the sitemap path.
Check four: server rules
On Apache, confirm the standard WordPress block exists in .htaccess and that mod_rewrite is on. On nginx, the location / block needs a try_files line that falls back to /index.php. A static-file rule that matches .xml and returns 404 before WordPress sees it is the usual culprit in that case. We cannot see your host, so these are patterns to look for, not a diagnosis.
After it returns 200
Resubmit in Search Console. If Search Console still cannot read it, that is a separate failure covered in sitemap could not be fetched, and a robots.txt block is covered in blocked by robots.txt. For how core and plugin sitemaps differ, see WordPress sitemap XML.
Unverified from outside: why one particular host returns 404, since that depends on server configuration and cache layers. The tests above isolate the layer; they do not replace your host's logs.
Questions people ask
What is the default WordPress sitemap URL?
WordPress core exposes a sitemap index at /wp-sitemap.xml, introduced in version 5.5. SEO plugins that take over generate their own, such as /sitemap_index.xml, and in that case the core URL may return 404 on purpose.
Why does flushing permalinks help?
WordPress serves sitemaps through its rewrite rules. If those rules are stale or missing, the request never reaches WordPress. Saving the Permalinks screen regenerates them. A WordPress core contributor also advised enabling pretty permalinks when a sitemap plugin was deactivated.
Is a 404 on wp-sitemap.xml always a problem?
No. If an SEO plugin provides a working sitemap elsewhere and you submit that one, the core URL returning 404 is expected. The fault is a 404 on the sitemap you actually submit.
Can the Discourage search engines setting cause it?
Yes. WordPress core documentation says sitemaps are disabled when the site is set to discourage search engines from indexing.
Related
Sources
- WordPress Core: New XML sitemaps functionality in WordPress 5.5, accessed 2026-11-12.
- WordPress documentation: Settings Reading screen, accessed 2026-11-12.
- Google Search Central: Build and submit a sitemap, accessed 2026-11-12.