An XML sitemap is a structured file listing the URLs a site wants search engines to know about, in a format designed for machines rather than people.
It uses a defined XML schema with url entries containing a loc element and optional lastmod. A single file may contain up to fifty thousand URLs and must not exceed fifty megabytes uncompressed; larger sites use a sitemap index referencing multiple files. It should be referenced in robots.txt and submitted in Search Console.
Sitemaps are most valuable where internal linking is weak, on very large sites, and on newly launched sites with few external links. They assist discovery but do not compel indexing — a listed URL may still be crawled and declined.
List only canonical, indexable URLs returning 200. Including redirects, noindexed pages or errors is contradictory and undermines trust in the file. Keep lastmod values honest rather than regenerating them on every deploy, and split by section so indexing problems can be isolated to an area.
Want to learn more? Explore our SEO Glossary or check out our expert guides on SEO strategies.