11 WordPress ServicesView all
8 industry verticalsAll industries
12 UK locationsAll locations
Home/Blog/SEO
SEO5 November 2026· 6 min read

WordPress XML Sitemap Not Working: How to Fix Sitemap Errors

Your WordPress sitemap is showing a 404, returning a blank page, or Google Search Console is reporting a parse error. Here is how to diagnose and fix each scenario.

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.

Frequently asked questions

Why is my WordPress sitemap showing a 404 error?+

A 404 on /sitemap.xml usually means your WordPress permalink structure has not been flushed. Go to Settings → Permalinks in your WordPress dashboard and click Save Changes without changing anything — this regenerates the rewrite rules. If you are using an SEO plugin like Yoast or Rank Math, also check that the sitemap feature is enabled in the plugin settings.

Why does my WordPress sitemap show a blank page?+

A blank sitemap is almost always caused by a PHP error that fires before WordPress outputs the XML. Enable WP_DEBUG and WP_DEBUG_LOG in wp-config.php and reload the sitemap URL — the error log will show exactly which plugin or theme file is causing the output to fail. Plugin conflicts and poorly coded themes are the most common culprits.

How do I fix a WordPress sitemap parse error in Google Search Console?+

A parse error means Google found the sitemap but could not read the XML correctly. The most common causes are stray characters before the XML declaration (usually from a plugin or theme outputting a space or BOM before WordPress headers), broken URLs containing unencoded special characters like & instead of &, or the sitemap containing URLs that return 301 redirects.

Should I submit my WordPress sitemap to Google Search Console?+

Yes. After fixing your sitemap, go to Google Search Console → Sitemaps and submit the URL (usually /sitemap.xml or /sitemap_index.xml for Yoast). Google will crawl it and show you how many URLs were discovered versus indexed. Resubmit any time you make significant structural changes to your site.

Related service

A broken sitemap means Google cannot reliably discover and index your pages. Our WordPress SEO service audits your entire crawlability setup — sitemap, robots.txt, internal linking and indexation — and fixes issues that are costing you rankings.

WordPress SEO Services →

Next article

SEO

WordPress Pages Not Indexed by Google: Why It Happens and How to Fix It

→
← All articles