An XML sitemap is a file that lists the URLs you want search engines to crawl and index. It helps Google discover new and updated pages faster, especially on large sites, new sites and pages with few internal links. Publish it at /sitemap.xml, list it in robots.txt, and submit it in Google Search Console.
What does a sitemap look like?
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.com/</loc>
<lastmod>2026-10-01</lastmod>
</url>
<url>
<loc>https://www.example.com/pricing</loc>
<lastmod>2026-09-14</lastmod>
</url>
</urlset>
Which pages belong in the sitemap?
Only the canonical, indexable version of pages you want in search: pages that return status 200, are not noindex, and are not redirected. Leave out duplicates, filtered or sorted URLs, login pages and thin utility pages.
What limits and tags matter?
- One sitemap file can hold up to 50,000 URLs and 50 MB uncompressed. Larger sites use a sitemap index file that lists several sitemaps.
lastmodis useful when it is accurate: Google uses it if it consistently matches real changes.- Google ignores
priorityandchangefreq.
How do you submit it?
- Add a line to robots.txt:
Sitemap: https://www.example.com/sitemap.xml - In Google Search Console, open Sitemaps and submit the URL.
- Do the same in Bing Webmaster Tools, which several AI assistants rely on.
Submitting does not guarantee indexing; it helps Google find the pages.
What are common sitemap errors?
| Error | Fix |
|---|---|
| Sitemap URLs that redirect or return 404 | List only final, working URLs |
| Pages marked noindex in the sitemap | Remove them, or remove the noindex |
| Important pages missing | Generate the sitemap from your CMS or database, not by hand |
| Sitemap blocked by robots.txt | Allow it |
lastmod set to today on every page | Use the real date each page changed |
A site crawl compares the sitemap with the pages actually linked on the site, and finds orphan pages, missing pages and URLs that fail. Google's reference is Build and submit a sitemap.
Check this on your own site
Spider's free check tests this and about 100 other things on any page, and links each problem to a guide like this one.