Playbook
    seo
    easy

    Fix a sitemap.xml returning 404

    Google cannot find your sitemap. Here is how to put one back at /sitemap.xml in under 10 minutes.

    10 minutesLast reviewed 2026-06-09

    What is happening

    Lemwatch tried to fetch https://yourdomain.com/sitemap.xml and got a 404. Google Search Console shows "Sitemap could not be fetched". New pages stop getting indexed within days.

    Fix it in 3 steps

  1. Check what is actually at /sitemap.xml. Open it in your browser. If you see a 404 page, you are missing the file. If you see HTML, your sitemap route is being intercepted by your CMS.
  2. Regenerate or install a sitemap plugin. WordPress: install Yoast or Rank Math, both auto-generate at /sitemap_index.xml (point Google there). Shopify: sitemap lives at /sitemap.xml automatically — if missing, the store is unpublished. Webflow, Wix, Squarespace: sitemap at /sitemap.xml is auto-generated when SEO is enabled in site settings.
  3. Update `robots.txt` to include Sitemap: https://yourdomain.com/sitemap.xml on its own line.
  4. If you generate your sitemap manually

    Make sure it:

  5. Starts with <?xml version="1.0" encoding="UTF-8"?> (no BOM, no leading whitespace).
  6. Lists fewer than 50,000 URLs and is under 50 MB uncompressed.
  7. Uses absolute URLs (https://...), not relative paths.
  8. Common gotchas

  9. Cloudflare cache is serving the old 404. Purge /sitemap.xml after fixing.
  10. `robots.txt` blocks the sitemap path. Check that Disallow: /sitemap.xml is not present.
  11. Trailing slash mismatch. /sitemap.xml/ and /sitemap.xml are different URLs. Pick one and stick to it.
  12. What this doesn't do

    This playbook is for the missing-sitemap case, not for sitemaps that exist but list broken URLs. For that, see the sitemap health guide.