A 404 response means the requested sitemap URL was not found or was not routed to the sitemap generator. The cause may be an incorrect URL, disabled feature, stale WordPress rewrite rules, an empty child sitemap, duplicate sitemap providers, caching, redirects, security rules, or missing web-server configuration.
Start with the correct sitemap URL
Yoast SEO normally provides a sitemap index rather than a single static sitemap file. Replace example.com with the site’s public hostname and open the address in a private browser window.
https://example.com/sitemap_index.xml
https://example.com/wp-sitemap.xml
https://example.com/sitemap.xml
If Yoast’s XML sitemap feature is enabled, use /sitemap_index.xml. The core WordPress sitemap may be available at /wp-sitemap.xml when Yoast’s feature is disabled. A file at /sitemap.xml is commonly produced by another plugin, WordPress core customization, or a physical file rather than Yoast SEO.
Identify the actual response
404 Not found
Check the URL, feature setting, permalinks, child-sitemap content, server rewrites, and conflicts.
200 Blank or malformed
Inspect the source, caches, XML/XSL delivery, output errors, and theme or plugin conflicts.
403 Forbidden
Review firewall, security-plugin, CDN, bot-protection, and server access rules.
5xx Server error
Check PHP errors, memory limits, server logs, plugin conflicts, and hosting health before changing SEO settings.
Troubleshoot in this order
Confirm XML sitemaps are enabled in Yoast SEO
In the WordPress dashboard, go to Yoast SEO > Settings > Site features. Under Technical SEO, confirm that XML sitemaps is enabled. Use Yoast’s View the XML sitemap control when available so you are testing the URL generated by the plugin.
Resave the WordPress permalink settings
Go to Settings > Permalinks and click Save Changes without changing the structure. This asks WordPress to rebuild its rewrite rules and is the primary quick fix recommended for a Yoast sitemap 404.
Test the sitemap again in a private window. Do not repeatedly switch permalink formats merely to force a reset.
Rebuild the sitemap and clear every cache layer
Return to Yoast’s Site features settings, turn XML sitemaps off, save, clear page cache, object cache, server cache, and CDN cache, then turn XML sitemaps back on and save again. This preserves the original TDWP fix while accounting for cached responses.
Remove duplicate sitemap generators and static files
Do not run multiple SEO or sitemap plugins that publish competing indexes. Check whether a physical sitemap.xml, sitemap_index.xml, or similarly named file exists in the public web directory. Back up the site before removing any file, and confirm that it is not managed by another required system.
Check whether the failing child sitemap has content
If the index loads but a child sitemap such as a category, post-type, or taxonomy sitemap returns 404, verify that eligible published items exist. An empty category sitemap, for example, may not be generated. Exclude unused content types or taxonomies from search results until they contain content that should be indexed.
Verify the WordPress and Site Address values
Under Settings > General, confirm that the WordPress Address and Site Address use the intended hostname and HTTPS format. A mismatch involving HTTP, HTTPS, www, a subdirectory, reverse proxy, or staging hostname can produce incorrect sitemap URLs or redirect loops.
Changing these fields can make a site inaccessible when the installation is configured unusually. Back up the database and involve the host when uncertain.
Exclude sitemap URLs from caching and minification
Page caches, server caches, CDNs, and optimization plugins should not serve stale HTML or a cached 404 for XML sitemap routes. Exclude sitemap_index.xml, child sitemap XML files, and the sitemap stylesheet from caching or minification according to the cache provider’s documentation.
Check redirect, firewall, and security rules
Review redirects that match *.xml, forced trailing slashes, hostname changes, language redirects, bot blocking, hotlink protection, and rules that treat XML as a static asset. A security service may return a branded 404 or 403 before WordPress receives the request.
Test for a plugin or theme conflict in staging
Create a backup and use a staging environment or a troubleshooting mode that affects only the logged-in administrator. Temporarily disable nonessential plugins and test with a current default theme. Re-enable components individually until the failure returns.
Do not deactivate essential production plugins blindly on a live ecommerce, membership, or business site.
Ask the host to review server rewrite rules
If WordPress permalinks or sitemap routes still fail, the Apache, NGINX, IIS, reverse-proxy, or container configuration may not pass the request to WordPress correctly. Provide the exact failing URL, status code, redirect chain, and time of the test to the hosting provider.
The original TDWP toggle reset
The original article used the following sequence. The menu labels have changed, but the underlying idea remains useful when Yoast’s generated output or a cache needs to be rebuilt.
- Open Yoast settings. Go to Yoast SEO > Settings > Site features.
- Disable XML sitemaps. Under Technical SEO, turn the feature off and save.
- Clear caches. Purge plugin, hosting, reverse-proxy, CDN, and browser caches.
- Enable XML sitemaps. Turn the feature back on and save.
- Open the index. Test
/sitemap_index.xmlin a private window. - Resave permalinks if needed. Use Settings > Permalinks > Save Changes.
When only one child sitemap returns 404
If /sitemap_index.xml loads but one listed sitemap fails, focus on that content type rather than resetting the entire site.
| Example | What to check | Likely action |
|---|---|---|
category-sitemap.xml |
Published posts assigned to eligible categories. | Add eligible content or exclude unused categories from search results. |
author-sitemap.xml |
Author archives enabled, authors have indexable published content. | Correct author archive settings or keep the archive excluded. |
product-sitemap.xml |
The product post type exists, is public, and has eligible published items. | Review ecommerce and Yoast search-appearance settings. |
post-sitemap2.xml |
Pagination range, recent deletions, cache, and plugin filters. | Clear caches, rebuild the sitemap, and inspect custom filters. |
Command-line checks for administrators
These examples are intended for site owners or developers with authorized shell access. Replace the domain with the real public URL.
Inspect headers and redirects
curl -I -L https://example.com/sitemap_index.xml
Review the final status, intermediate redirects, server headers, cache indicators, and content type. A healthy XML response commonly returns a successful status with an XML content type, although exact headers vary.
Flush WordPress rewrite rules with WP-CLI
wp rewrite flush
A hard flush that also updates an Apache .htaccess file may use:
wp rewrite flush --hard
What to send your hosting provider
- The exact sitemap index and child-sitemap URLs.
- The date and time of the most recent test, including timezone.
- The final HTTP status and complete redirect chain.
- Whether normal pretty permalinks also return 404.
- Whether the failure occurs with cache and CDN bypassed.
- Relevant PHP, web-server, firewall, and reverse-proxy log entries.
- Recent changes to domains, HTTPS, migrations, plugins, themes, or server configuration.
After the sitemap works
Open the index and several child sitemaps, confirm that the URLs use the correct HTTPS hostname, and verify that listed content is intended for indexing. Then submit or resubmit the sitemap index in the appropriate search-engine webmaster tools.
- Do not add a normal HTML-page redirect from the sitemap to the homepage.
- Do not block the sitemap in
robots.txtwhile expecting crawlers to use it. - Do not worry if the XML sitemap itself carries a
noindex, followheader; the sitemap can still be fetched and processed. - Keep only one authoritative sitemap system unless a specialized extension intentionally adds a separate sitemap type.
- Recheck the sitemap after migrations, hostname changes, permalink changes, and major SEO-plugin updates.
What changed from the original 2014 tutorial
The original article offered a concise disable-and-enable reset. The revised page keeps that procedure but places it within a safer troubleshooting order: verify the correct Yoast sitemap URL, enable the current setting, resave permalinks, clear caches, remove duplicate generators, inspect empty child sitemaps, verify site URLs, test conflicts, and escalate server rewrites to the host.
Article status
Archived discussion
The original page included an inactive reply form but no preserved comments. The form has been removed so visitors are not asked to submit personal information to an endpoint that may no longer work.
Questions, corrections, and feedback about this tutorial can be sent through the redesigned TDWP contact page.