WordPress Sitemap Not Working? 7 Fixes (2026)

Is your WordPress sitemap not working? Back in December 2008, right after upgrading to WordPress 2.7, my trusted Google XML Sitemaps plugin started showing write errors and stopped updating our sitemap. The fix turned out to be a changed server path at our host, Dreamhost. Sitemaps work differently in 2026: most are generated on the fly, so write errors are rare, but sitemaps still go missing, return 404 or show errors in Search Console. Here’s how to fix them.

WordPress sitemap not working fixes

Quick answer: Find your real sitemap URL first (/wp-sitemap.xml for WordPress core, /sitemap_index.xml for Rank Math or Yoast). If it returns a 404, re-save your permalinks and make sure only one plugin generates the sitemap. If it shows an XML error, look for stray spaces or PHP output from a theme or plugin. Exclude the sitemap from your cache, then resubmit it in Google Search Console.

Where is your WordPress sitemap?

  • WordPress core (since 5.5): /wp-sitemap.xml
  • Rank Math and Yoast SEO: /sitemap_index.xml (they turn off the core sitemap)
  • XML Sitemap Generator for Google (the old “Google XML Sitemaps” plugin): usually /sitemap.xml

If WordPress is installed in a subfolder (like ours, in /archives/), the sitemap lives under that folder too.

How to fix a WordPress sitemap that isn’t working

1. Re-save permalinks

A 404 on the sitemap usually means the rewrite rules are stale. Go to Settings > Permalinks and click Save Changes without changing anything. This flushes the rules.

2. Use only one sitemap plugin

Two SEO or sitemap plugins fighting over the same URL cause blank pages, redirects or 404s. Keep one (for example your SEO plugin) and disable sitemaps in the others.

3. Check the sitemap is enabled

In Rank Math, the Sitemap module must be on; in Yoast, the XML sitemaps feature under Settings. The core sitemap is off if “Discourage search engines” is ticked in Settings > Reading.

4. Fix XML errors

“XML declaration allowed only at the start” means something prints output before the sitemap: often a blank line before <?php or after ?> in functions.php or a plugin file. Temporarily switch themes or disable plugins one by one to find it.

5. Exclude it from caching and the CDN

Caching plugins and CDNs can serve an old sitemap. Exclude sitemap URLs in LiteSpeed Cache, WP Rocket or your CDN, then purge the cache.

6. Check robots.txt and security plugins

Make sure robots.txt doesn’t block the sitemap and that a firewall isn’t blocking Googlebot. Our guide on URLs blocked by robots.txt shows how to check.

7. Write errors (file-based plugins)

If an older plugin writes a physical sitemap.xml file, it needs a correct absolute path and write permission (644 for files, 755 for folders; avoid 777). That’s what bit us in 2008: our host changed the server path and the plugin’s saved path no longer existed. Better still, switch to a plugin that generates the sitemap dynamically.

Submit and test the sitemap

Add the sitemap in Google Search Console under Sitemaps and check its status. Google retired its old sitemap “ping” URL in 2023, so submitting in Search Console and listing the sitemap in robots.txt is the way to go. If your site isn’t verified yet, see how to verify WordPress in Google Search Console. For Bing, submit it in Bing Webmaster Tools.

FAQ

Why does my WordPress sitemap show a 404?

Usually stale permalinks, a disabled sitemap feature, or two plugins clashing. Re-save permalinks and check that one plugin owns the sitemap.

Do I still need a sitemap plugin?

No. WordPress has a built-in sitemap. SEO plugins like Rank Math and Yoast add more control, such as excluding post types or adding images.

Why does Search Console say “Couldn’t fetch”?

It can be temporary. Open the sitemap URL in a browser; if it loads, wait a day and resubmit. If not, fix the errors above first.

Found this useful? Share it with someone who needs it.

Get our free weekly email: new tech guides and tools, no spam.

New and updated tech guides, a free tool worth bookmarking and one useful pick, once a week. No spam, unsubscribe anytime.

One email a week. Unsubscribe anytime. See our privacy policy.

Related Tech Guides

Leave a Reply

Your email address will not be published. Required fields are marked *

3 Comments

  1. Hmm,
    I am hosted with MediaTemple, and have noticed that the plugin have stopped working after upgrading to WordPress 2.7; in fact, my entire site stops functioning until I disable the plugin (by renaming it’s folder on FTP). No error messages like the ones in your screenshot, just plain unresponsiveness.

  2. This is because Dreamhost moved you to a different server recently (you should have gotten a couple of emails about it). The “.funnyname” has to do with their NFS mounting for storage on the web servers. This is why DH recommends always using “/home/youruser/whatever”.

    Kevin