An XML sitemap is a file on your web server that lists the URLs you want search engines to crawl and index, often with extra hints such as when each page was last modified. It helps crawlers discover pages efficiently — especially on large sites, or ones with pages that aren't well linked internally.
Include only canonical, indexable pages that return a 200 status — the URLs you genuinely want in Google. Leave out anything marked noindex, redirected, blocked by robots.txt, or duplicated by URL parameters, because listing them sends mixed signals. A single sitemap file caps at 50,000 URLs and 50MB uncompressed; beyond that, split content into multiple sitemaps referenced by one sitemap index file.
Point to the sitemap's location in your robots.txt and submit it in Google Search Console so crawlers find it fast. The real payoff is in the lastmod dates: an accurate one tells Google which pages changed and deserve a recrawl.
A 12,000-product store split its URLs into a sitemap index with a separate file per category and added honest lastmod timestamps. After a price-and-copy refresh on 400 product pages, Google recrawled those updated URLs within days instead of weeks, because the sitemap flagged exactly what had changed.
An accurate sitemap is a small but load-bearing part of technical SEO.