SEO, schema, meta tags
Fix Missing XML Sitemap: How to Create and Submit sitemap.xml
No sitemap.xml on your site means Googlebot has to discover URLs through internal links alone. Generate one, submit it in Search Console, and reference it from robots.txt.
What's happening
An XML sitemap is a machine-readable inventory of the URLs you want indexed. When Googlebot or Bingbot first crawls a domain without one, the only discovery path is internal linking — anchors found while crawling existing pages. That works for small sites, but it leaves orphan pages, deep pagination, and freshly published URLs at the mercy of when a crawler happens to find a link pointing to them.
Search Console explicitly surfaces this gap. The Sitemaps report under the Indexing section will show no submitted sitemaps, and the URL Inspection tool will report new URLs as 'Discovered - currently not indexed' for longer than necessary. The sitemaps protocol (sitemaps.org) is supported by all major engines, including Yandex, Baidu, and DuckDuckGo (via Bing).
A sitemap is not a ranking signal in itself, but it is a strong discovery signal. Combined with a fresh lastmod timestamp it tells crawlers which URLs changed since the last fetch, which directly affects recrawl priority and time-to-index for new content.
Why it matters
The most measurable impact is indexation latency. New URLs without a sitemap entry frequently take 7-21 days to appear in Google's index versus 1-3 days for properly submitted ones. For a publishing site, that delay is the difference between ranking for a fresh news query and missing the spike entirely.
Coverage gaps are the second cost. Pages that are not linked from the navigation, or are only reachable via faceted filters, get orphaned. Without a sitemap they may never enter the index at all, so SKU pages, archive pages, and tag pages quietly disappear from organic traffic reports.
Finally, you lose diagnostic visibility. The Sitemaps report in Search Console reports submitted vs. indexed counts per sitemap, which is the cleanest way to track indexation health over time. With no sitemap, you are debugging coverage issues with one hand tied.
Common causes
- The CMS or framework was never configured to generate a sitemap (older WordPress without Yoast/RankMath, custom Next.js builds without a sitemap.ts route).
- A sitemap was generated but not referenced from robots.txt and not submitted in Search Console.
- The sitemap file returns a 404 or 500 because of a broken build step or missing route handler.
- The sitemap exists at a non-standard path (e.g. /sitemap_index.xml) and was never discovered.
- A staging-only sitemap was deployed to production and points to staging URLs.
- A sitemap was deleted during a migration and never re-added.
Detect this on your site
Run a quick scan with the SEO Auditor. The tool surfaces this exact issue with the records and context needed to apply the fix below.
Open SEO AuditorHow to fix it
- 1
Check whether a sitemap already exists
Visit /sitemap.xml and /sitemap_index.xml on your domain directly. Look at the response code in DevTools or curl — anything other than 200 with valid XML means you need to generate or repair the sitemap. Also check robots.txt for a Sitemap: directive.
- 2
Generate a sitemap with your stack
Use the native generator for your framework: Next.js 14+ supports app/sitemap.ts that returns a MetadataRoute.Sitemap; WordPress has Yoast or RankMath; Astro has @astrojs/sitemap. The output should be a valid sitemap.xml file at the site root listing every canonical URL with lastmod, optional changefreq, and priority.
- 3
Reference it from robots.txt
Add a line Sitemap: https://yourdomain.com/sitemap.xml to /robots.txt. Use the absolute URL with the canonical protocol (https) and host. If you have multiple sitemaps in an index file, list each one or list the index — both are accepted.
- 4
Submit it in Google Search Console and Bing Webmaster Tools
In Search Console, open Indexing > Sitemaps and submit the full URL. Bing Webmaster Tools has an equivalent Sitemaps report. Submission triggers a fetch and validation pass; errors show up within a few hours.
- 5
Validate the sitemap
The sitemap must be UTF-8 encoded, under 50 MB uncompressed, and contain at most 50,000 URLs. Each URL must be a fully qualified absolute URL on the same hostname. Wrong scheme (http vs https) or wrong host fails validation silently.
- 6
Monitor the Sitemaps report weekly
Track Submitted vs Indexed counts. A growing gap means coverage problems (noindex headers, soft 404s, canonical conflicts). Errors per sitemap point to malformed XML, redirected URLs, or 404s in the listed set.
Example
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/</loc>
<lastmod>2026-04-29</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://example.com/blog/seo-checklist</loc>
<lastmod>2026-04-20</lastmod>
</url>
</urlset>Minimal valid sitemap.xml structure
Frequently asked
Whenever URLs are added removed or significantly changed. Most static-site generators rebuild the sitemap on every deploy which is the right cadence. The lastmod timestamp on each URL should reflect the actual content change date not the build date — Google ignores fake lastmod values.
Yes. Even small sites benefit because the sitemap closes discovery gaps for pages that are not in the main navigation and it gives you a single source of truth for indexation diagnostics in Search Console.
No. URLs in a sitemap should be canonical indexable and return 200. Including noindex or canonicalized URLs creates conflicting signals and clutters the Sitemaps report with warnings.
Related fixes
SEO, schema, meta tags
Fix Sitemap Too Large: Split sitemap.xml Into a Sitemap Index
SEO, schema, meta tags
Fix Missing robots.txt: Add a Crawl Directives File
SEO, schema, meta tags
Fix robots.txt Disallow All: Unblock Googlebot Site-Wide
SEO, schema, meta tags
Fix Orphaned Pages: Add Internal Links to Isolated URLs