Your sitemap is your roadmap to Google — and it is gone
A sitemap tells Google which pages exist on your site, when they were last updated, and how important they are relative to each other. Google uses this information to prioritise its crawling. Without a sitemap, Google still crawls your site by following links — but it does so less efficiently, less completely, and less frequently.
Yoast SEO is the most popular WordPress SEO plugin, used on over 13 million sites. It generates your XML sitemap automatically, adding new pages as you publish them and removing pages when you delete or noindex them. When the sitemap works, you never think about it. When it breaks, you do not think about it either — because the breakage is invisible. There is no error on your site. No warning in your dashboard. No email from Yoast. Your site continues to function perfectly for visitors. The only thing that breaks is Google's ability to efficiently find and index your content.
The damage accumulates slowly. In the first week, Google notices the sitemap is returning 404 and retries. In the second week, it reduces its reliance on your sitemap and falls back to link-based discovery. By the third week, new pages are not being found, updated pages are not being recrawled on schedule, and your indexed page count starts dropping. By week four, you see the traffic decline in your analytics. By week six, you are wondering what happened. The answer has been sitting at /sitemap_index.xml the entire time — a 404 page that nobody checked.
What causes Yoast SEO sitemap 404 errors
1. Permalink structure needs flushing
This is the most common cause and the easiest to fix. Yoast SEO generates sitemaps using WordPress rewrite rules — the same system that handles your pretty permalinks. These rewrite rules are stored in the database and written to your .htaccess file. When you update WordPress, update Yoast, install a new plugin, or change any setting that affects URL routing, the rewrite rules can become stale.
When the rewrite rules are stale, WordPress does not know that /sitemap_index.xmlshould be handled by Yoast. It treats the request like any other URL, cannot find a matching page or post, and returns a 404. The fix is to go to Settings > Permalinks in your WordPress admin and click "Save Changes" without actually changing anything. This forces WordPress to regenerate all rewrite rules, including Yoast's sitemap rules.
The frustrating thing is that this can happen without you doing anything. A WordPress auto-update, a plugin that modifies rewrite rules during activation, or even a database migration can invalidate the cached rewrite rules. Your sitemap was working yesterday and is broken today, and you made no changes.
2. .htaccess rewrite rules broken or missing
On Apache servers (which power the majority of WordPress sites), URL rewriting depends on the .htaccess file in your WordPress root directory. This file contains the mod_rewrite rules that translate pretty URLs like /blog/my-post/into the internal WordPress query format. Yoast's sitemap relies on these same rewrite rules.
If your .htaccess file is corrupted, deleted, or modified incorrectly, all URL rewriting breaks — including your sitemap. Common causes of .htaccess problems include: a security plugin writing malformed rules, a backup plugin failing mid-write and leaving a truncated file, a file permission change that prevents WordPress from writing to the file, and manual editing that introduces a syntax error.
When .htaccess is broken, your sitemap returns 404, but so do all your posts and pages that use pretty permalinks. If you notice that both your sitemap AND your blog posts are returning 404 while your homepage works, the problem is almost certainly .htaccess. Refer to the .htaccess error guide for detailed fix steps.
3. Plugin conflict overriding Yoast rewrite rules
WordPress allows any plugin to register and modify rewrite rules. When two plugins register conflicting rules — or when a plugin clears and regenerates rules without including other plugins' rules — sitemaps break. The most common conflicts are with other SEO plugins (running two SEO plugins simultaneously is a well-known cause of sitemap issues), custom post type plugins that register their own rewrite rules, and caching plugins that modify the rewrite system.
If you recently installed or activated a new plugin and your sitemap broke immediately after, that plugin is likely the cause. Deactivate it, flush permalinks, and check if the sitemap returns. If it does, the plugin has a rewrite rule conflict with Yoast. You can either keep the new plugin and configure it to not conflict, contact the plugin developer, or choose between the two.
A particularly common conflict is having both Yoast SEO and another SEO plugin installed — even if the other plugin is deactivated. Some SEO plugins register rewrite rules during activation and do not fully clean them up during deactivation. Delete (not just deactivate) any SEO plugin you are not using. Refer to the Yoast SEO plugin page for known compatibility issues.
4. Server configuration not supporting URL rewriting
On Apache servers, URL rewriting requires mod_rewrite to be enabled and AllowOverride All to be set in the Apache virtual host configuration for your WordPress directory. If your hosting provider or server administrator changes the Apache configuration, disables mod_rewrite, or sets AllowOverride None, all WordPress rewrite rules stop working — including your sitemap.
On Nginx servers, there is no .htaccess file. Rewrite rules are defined in the Nginx server configuration. WordPress provides a set of Nginx rewrite rules that must be included in the server block. If these rules are missing or incomplete, WordPress permalinks and sitemaps do not work. Unlike Apache, where WordPress can auto-generate .htaccess, Nginx configuration must be updated manually.
If you recently migrated your site to a new server or hosting provider and your sitemap broke, the server configuration is the likely cause. Check with your hosting provider to confirm that URL rewriting is properly configured for WordPress.
5. Yoast sitemap feature disabled
This seems obvious, but it is worth checking. In Yoast SEO, go to Settings > Site Features and check that the "XML sitemaps" toggle is enabled. If someone on your team — another admin, a developer, a consultant — disabled sitemaps, the /sitemap_index.xml URL returns a 404. Yoast does not display a warning anywhere else in the admin panel when sitemaps are disabled. You would only know by checking the settings page or visiting the sitemap URL directly.
6. WordPress in maintenance mode or recovery mode
When WordPress is in maintenance mode (during an update) or recovery mode (after a fatal error), it may return 503 responses for all requests, including the sitemap. If a failed update leaves WordPress stuck in maintenance mode, the sitemap returns 503 indefinitely. Google treats repeated 503 responses similarly to 404 — it reduces crawl frequency and eventually stops trying.
How to fix each Yoast sitemap 404 cause
Flush permalinks
Go to Settings > Permalinks. Click "Save Changes" without changing anything. Visit /sitemap_index.xml in your browser. If the sitemap loads, the fix worked. If not, continue to the next step.
Regenerate .htaccess
Download a backup of your current .htaccess file via FTP or your hosting file manager. Delete the .htaccess file from your WordPress root directory. Go to Settings > Permalinks and click "Save Changes." WordPress generates a new .htaccess file with clean rewrite rules. Check your sitemap. If it works, the old .htaccess was the problem. If you had custom rules in your .htaccess (redirects, security rules, caching headers), add them back one section at a time, testing the sitemap after each addition.
Deactivate conflicting plugins
Deactivate all plugins except Yoast SEO. Flush permalinks. Check the sitemap. If it works, reactivate plugins one at a time, flushing permalinks and checking the sitemap after each activation. When the sitemap breaks, you have found the conflicting plugin. Either configure that plugin to avoid the conflict, contact its developer, or replace it.
Check server configuration
On Apache, verify that mod_rewrite is enabled: apache2ctl -M | grep rewrite. Verify that AllowOverride All is set for your WordPress directory in the Apache virtual host configuration. On Nginx, verify that the WordPress rewrite rules are included in your server block. Contact your hosting provider if you are unsure — most managed WordPress hosts handle this automatically.
Enable Yoast sitemaps
In Yoast SEO, go to Settings > Site Features. Toggle "XML sitemaps" to enabled. If you do not see this option, you are running an older version of Yoast — update to the latest version first.
How to monitor your sitemap with Uptrue
Uptrue's HTTP monitoring can check your sitemap URL every 60 seconds and alert you the moment it returns a 404. This catches the problem on the same day it occurs — not three weeks later when you notice the traffic decline.
Step 1: Set up an HTTP monitor on your sitemap URL
- Sign up at uptrue.io/signup (free plan available)
- Click Add Monitor from your dashboard
- Select HTTP/HTTPS as the monitor type
- Enter
https://yourdomain.com/sitemap_index.xmlas the URL - Set expected status to 200
- Set the check interval to 5 minutes (sitemaps do not change frequently)
- Configure alerts — Slack, email, or Microsoft Teams
The moment your sitemap returns a 404 instead of 200, Uptrue alerts you. You fix it in 30 seconds by flushing permalinks. Google never misses a crawl. Your rankings stay stable. That is the difference between monitoring your sitemap and discovering the problem in your analytics three weeks later.
Step 2: Add a keyword monitor to verify sitemap content
- Click Add Monitor again
- Select Keyword as the monitor type
- Enter
https://yourdomain.com/sitemap_index.xml - Set the keyword to "sitemap"
- Set the check type to "Page must contain"
- Set the interval to 5 minutes
This catches edge cases where the sitemap URL returns a 200 but serves incorrect content — like a WordPress error page that happens to return a 200 status code, or a caching plugin that cached an error page. The keyword check verifies that the response actually contains sitemap XML data.
Step 3: Monitor individual sub-sitemaps
Yoast generates multiple sub-sitemaps: post-sitemap.xml, page-sitemap.xml, category-sitemap.xml, and others depending on your content types. The sitemap index can work while individual sub-sitemaps return 404. Monitor your most important ones:
/post-sitemap.xml— your blog posts and main content/page-sitemap.xml— your static pages/product-sitemap.xml— if you run WooCommerce
Step 4: Set up alerts that reach you fast
- Slack — instant notification when any sitemap returns 404
- Microsoft Teams — visibility for the SEO and development team
- Email — written record for every sitemap failure incident
- Webhook — trigger an automated permalink flush or alert your SEO tool
Check your sitemap health right now
Instant health score across uptime, SSL, DNS, security headers, and performance. See if your sitemap is accessible and serving valid content.
Check Your Website ScorePreventing sitemap 404 errors
Flush permalinks after every update
After every WordPress core update, Yoast update, or plugin update that might affect URL routing, go to Settings > Permalinks and click Save Changes. This takes five seconds and prevents the most common cause of sitemap 404 errors. Make it part of your update checklist.
Do not run multiple SEO plugins
Choose one SEO plugin and remove all others. Do not just deactivate them — delete them. Leftover rewrite rules from deactivated SEO plugins can conflict with Yoast. One SEO plugin. One set of sitemap rules. No conflicts.
Back up .htaccess before editing
Before any manual changes to .htaccess, before any plugin that modifies it, download a backup. If something breaks, you can restore the working version immediately. Better yet, use version control on your .htaccess file so you can track exactly what changed and when.
Check Google Search Console regularly
Google Search Console shows you when it last successfully fetched your sitemap and whether it found any errors. Check the Sitemaps section weekly. If the status shows "Couldn't fetch" or "Has errors," your sitemap is broken and Google is telling you — but only if you check.
The silent SEO killer you never check
Your sitemap is not glamorous. It is an XML file that nobody visits. It does not have a design. It does not convert visitors. It does not appear in your analytics. But it is the foundation of your relationship with Google. When it breaks, nothing dramatic happens. No error page for visitors. No alarm. No notification from Yoast. Just a quiet 404 on a URL you never check, followed by a slow, steady decline in the organic traffic that drives your business.
Uptrue HTTP monitoring checks your sitemap URL every five minutes. If it returns a 404, you know immediately. You flush permalinks. The sitemap comes back. Google's next crawl succeeds. Your rankings hold. A 30-second fix that prevents a month-long SEO decline — but only if you know the problem exists.
Stop losing rankings to a broken sitemap
Free plan available. HTTP monitoring on your sitemap URL with instant alerts. Keyword monitoring to verify sitemap content. Slack, Teams, email, and webhook alerts. No credit card required.
Frequently asked questions
Why is my Yoast SEO sitemap returning a 404 error?
Yoast SEO generates sitemaps using WordPress rewrite rules rather than creating physical XML files on disk. When your permalink structure breaks, the .htaccess file is corrupted, or another plugin conflicts with Yoast rewrite rules, the virtual sitemap URL stops resolving and returns a 404. The most common fix is to go to Settings > Permalinks in WordPress and click Save Changes without changing anything — this flushes and regenerates the rewrite rules. If that does not work, the issue is usually a corrupted .htaccess file, a conflicting plugin that overrides rewrite rules, or a server configuration that does not support URL rewriting.
How does a broken sitemap affect my Google rankings?
Google uses your sitemap to discover and prioritise pages for crawling. When your sitemap returns a 404, Google loses its primary roadmap to your content. It can still discover pages through internal links, but the process is slower and less complete. New pages take longer to get indexed. Updated pages take longer to be recrawled. Pages that are only accessible through deep navigation may not be discovered at all. Over weeks, this causes a gradual decline in indexed pages, which leads to a decline in organic search traffic. The decline is slow enough that most site owners attribute it to algorithm changes or seasonal trends rather than a technical sitemap failure.
Can I check if my Yoast sitemap is working?
Visit yourdomain.com/sitemap_index.xml in your browser. If you see an XML document listing your sub-sitemaps (post-sitemap.xml, page-sitemap.xml, category-sitemap.xml, etc.), your sitemap is working. If you see a 404 page, it is broken. Also check each sub-sitemap by clicking on it — sometimes the index loads but individual sub-sitemaps return 404. Check Google Search Console under Sitemaps to see when Google last successfully fetched your sitemap and whether it reported any errors. If the last successful fetch was weeks or months ago, your sitemap has been broken for that long.
Does Yoast SEO create a physical sitemap file?
No. Yoast SEO generates sitemaps dynamically using WordPress rewrite rules. There is no physical sitemap_index.xml file in your WordPress directory. When someone requests /sitemap_index.xml, WordPress intercepts the request through its rewrite system and Yoast generates the XML content on the fly. This is why permalink and rewrite rule issues break the sitemap — there is no file to fall back on. If the rewrite rules are missing or corrupted, WordPress does not know that /sitemap_index.xml should be handled by Yoast, so it returns a standard 404 page.