A sitemap is a file listing the URLs on a site that you want search engines to know about. The XML format is the one search engines consume.
An XML sitemap lists URLs with optional lastmod dates, and may be split into multiple files referenced by a sitemap index. A single file is limited to fifty thousand URLs and fifty megabytes uncompressed. It should be submitted in Search Console and referenced from robots.txt.
Sitemaps assist discovery, particularly on large sites, newly launched sites, and sites with pages that are poorly internally linked. They do not guarantee indexing — Google treats a sitemap as a suggestion, and a page listed there may still be crawled and declined.
Include only canonical, indexable URLs that return 200. Listing redirects, noindexed pages or 404s is a contradictory signal and reduces trust in the file. Keep lastmod dates accurate rather than regenerating them on every build, and split large sitemaps by section so indexing problems can be isolated.
Want to learn more? Explore our SEO Glossary or check out our expert guides on SEO strategies.