An XML sitemap tells search engines which pages exist on your site and when they were last updated. When it breaks, Google cannot reliably discover your content — and pages stop getting indexed. WordPress sitemap failures almost always come down to five causes: flushed permalinks, a PHP error suppressing output, a plugin conflict, a misconfigured SEO plugin, or a robots.txt rule blocking the sitemap URL.
Fix 1: Flush your WordPress permalinks
Go to Settings → Permalinks in your WordPress admin and click Save Changes without modifying anything. This regenerates the .htaccess rewrite rules WordPress uses to serve sitemap URLs. After saving, reload your sitemap URL (/sitemap.xml, /sitemap_index.xml or /wp-sitemap.xml depending on your setup). This resolves the majority of sitemap 404 errors.
WordPress SEO services →Fix 2: Confirm your SEO plugin is generating the sitemap
If you use Yoast SEO, go to Yoast → Settings → Advanced → XML Sitemaps and confirm the toggle is on. In Rank Math, go to Rank Math → Sitemap Settings and check that the sitemap is enabled and the correct post types are included. If you use the default WordPress sitemap (wp-sitemap.xml), check that no plugin is disabling it via the wp_sitemaps_enabled filter.
Fix 3: Check robots.txt is not blocking the sitemap
Open your robots.txt file at /robots.txt. Confirm there is no Disallow: /sitemap.xml or Disallow: /sitemap_index.xml rule. Also check that the Sitemap: directive at the bottom of robots.txt points to the correct URL. A common issue after migrating from HTTP to HTTPS is a robots.txt Sitemap directive still pointing to the http:// version.
Fix 4: Enable debug logging to find PHP errors
Add these lines to wp-config.php to find errors that blank the sitemap output:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);Reload the sitemap URL and check wp-content/debug.log for errors. The log will identify the exact file causing the problem. Set WP_DEBUG back to false once you have resolved the issue — never leave debug mode active on a live site.
Fix 5: Deactivate conflicting plugins
If you have multiple SEO plugins active simultaneously, they will conflict over sitemap generation. Only one SEO plugin should be active at a time. Also check whether caching plugins are serving a cached version of a previously broken sitemap — clear all caches after fixing the underlying issue.
ImportantAfter fixing your sitemap, submit it to Google Search Console via Sitemaps → Add a new sitemap. Even if you submitted it previously, resubmitting after a fix prompts Google to recrawl it immediately rather than waiting for its next scheduled visit. If Search Console shows "Fetched" but no URLs indexed, the issue is a broader crawl budget or indexability problem, not the sitemap itself.