Skip to main content

Fix Guides

How to Fix a Missing XML Sitemap

Give search engines a machine-readable list of your pages.

Quick fix

To fix a missing XML sitemap, generate a sitemap.xml listing your canonical, indexable URLs (with accurate lastmod dates if possible), serve it at https://yoursite.com/sitemap.xml, reference it in robots.txt, and submit it in Google Search Console. Re-scan to confirm.

Without a sitemap, search engines rely entirely on following links to discover pages — slow for new sites and easy to miss important URLs. An XML sitemap is a simple file that lists what you want indexed and speeds up discovery.

Check your website

See how your site handles how to fix a missing xml sitemap — free, no account needed.

Business impact

For a new or growing site, a sitemap is often the difference between pages being found in days versus weeks. It is free, takes little maintenance if generated dynamically, and is expected by anyone serious about search visibility.

Why this happens

Sitemaps are missing when nothing is served at /sitemap.xml, the file was never created, or it exists but returns HTML/404. CMS sites often need a plugin or setting enabled; custom apps need a generator or hand-maintained file (dynamic generation is best practice).

How to confirm the issue

Manually: open https://yoursite.com/sitemap.xml — you should see XML with <urlset> or a sitemap index. Search Console → Sitemaps shows submission status.

With Plexa Trust: look for "Sitemap Missing" in your scan report; re-scan after fixing.

Step-by-step fix

  1. List every canonical, indexable URL you want in search results.

  2. Generate sitemap.xml (plugin, CMS feature, or dynamic endpoint).

  3. Include accurate <lastmod> dates where possible.

  4. Serve it at /sitemap.xml with Content-Type application/xml.

  5. Add Sitemap: https://yoursite.com/sitemap.xml to robots.txt.

  6. Submit the URL in Google Search Console and Bing Webmaster Tools.

  7. Re-scan to confirm.

Platform-specific fixes

WordPress

  1. Enable XML sitemaps in Yoast SEO, Rank Math, or WordPress core (Settings → Reading in WP 5.5+).

  2. Confirm /wp-sitemap.xml or your plugin's URL works.

  3. Add the sitemap URL to robots.txt if not added automatically.

Shopify

  1. Shopify generates /sitemap.xml automatically.

  2. If missing, check that the store is live and not password-protected.

Custom / PHP sites

  1. Build a dynamic sitemap endpoint that lists current URLs with lastmod.

  2. Serve via rewrite rule (e.g. /sitemap.xml → sitemap.php).

  3. Use a sitemap index if you exceed 50,000 URLs.

Cloudflare / CDN

  1. Ensure /sitemap.xml is not cached as an old 404.

  2. Purge cache after publishing a new sitemap.

How to verify the fix

  • Generate dynamically so new pages appear automatically.

  • Only include URLs that return 200, are canonical, and are indexable.

  • Re-scan and verify in Search Console after submission.

Common mistakes

  • Listing 404, redirected or noindex URLs in the sitemap.

  • Forgetting to reference the sitemap in robots.txt.

  • Letting a hand-maintained sitemap go stale after adding pages.

Frequently asked questions

Does a sitemap guarantee indexing?

No. It aids discovery; Google still decides what to index based on quality and other signals.

What URLs should I include?

Only canonical, indexable pages that return HTTP 200 — not admin, login, or noindex pages.

How big can a sitemap be?

Up to 50,000 URLs or 50MB per file. Split into multiple sitemaps with a sitemap index beyond that.

Do I need lastmod?

Not required, but accurate lastmod helps crawlers prioritise changed pages.

sitemap.xml vs sitemap_index.xml?

A sitemap index points to multiple sub-sitemaps — use it for large sites.

Should I submit in Search Console?

Yes. Submission helps Google find and process it faster, especially on new sites.

Can I have multiple sitemaps?

Yes. Reference them all from a sitemap index and/or list each in robots.txt.

How do I confirm it worked?

Load /sitemap.xml, check Search Console status, and re-scan with Plexa Trust.

Think you've fixed it?

Run a free scan to verify the issue is resolved. Upgrade to Pro on Plexa Trust for the full audit, monitoring alerts, and score history.

Verify with a free scan

Upgrade to Pro for monitoring