What is a sitemap?
An XML sitemap is a list of the URLs on your site that you want search engines to crawl, with optional hints about when each one changed. It is a timetable for crawlers, not a ranking lever.
How a crawler finds pages
Search engines discover URLs in two main ways: following links from pages they already know, and reading lists you give them. Links work well for pages that are linked prominently. They work badly for pages that are new, deep in the site, or not linked at all.
Step through the demo. In Links only mode the crawler needs several rounds to reach the product pages, and it never finds the two orange orphan pages, because nothing links to them. Switch to Links + sitemap and every URL is known from the first round.
Real crawlers don't move in tidy rounds, and a known URL isn't instantly crawled or indexed. The shape is right, though: sitemaps shorten discovery and catch pages the link graph misses.
The crawler starts at the home page. It knows nothing else yet.
Do you need one?
Google's documentation is specific. A sitemap helps most when:
- the site is large, so new or updated pages are easy to overlook;
- the site is new and has few external links pointing to it;
- there are poorly linked or orphaned pages (landing pages, filtered archives, old content);
- there is rich media or news you want described with image, video or news extensions.
A small site (roughly 500 pages or fewer) with good internal links may not need one. Even then it costs nothing and gives you a per-sitemap indexing report in Search Console.
The crawl demo above makes a simple point: a page existing on your server and a crawler knowing it exists are separate facts. Closing gaps like that, between how something looks and how it actually works, is what ahaboo's narrated explainers do for topics like photosynthesis.
Anatomy of one entry
<url> <loc>https://example.com/kettles/blue</loc> <lastmod>2026-09-21</lastmod> </url>
loc: required, the full canonical URL.lastmod: optional, when the page's content last meaningfully changed.changefreq,priority: optional, ignored by Google.
Sitemap best practices
- List canonical URLs only. No redirects, 404s, noindexed pages or
?sort=variants. Every non-canonical URL weakens the file as a signal. - Use the exact form you want indexed. Same protocol, same host (www or not) and the same trailing-slash convention as your canonical tags.
- Make lastmod truthful or leave it out. Stamping today's date on every URL at every build teaches crawlers to ignore it.
- Split before you hit limits. 50,000 URLs or 50 MB per file; many sites split by section for clearer reporting. See the splitter.
- Declare it in robots.txt with an absolute
Sitemap:URL. Other search engines read that line too. How to add it. - Submit it in Search Console and watch the “Discovered” vs indexed numbers. Step by step.
- Keep it fresh automatically. A sitemap that is six months stale is worse than none. Generate it on publish, or rebuild it from your export on a schedule.
Questions people ask
What is a sitemap in simple terms?
/sitemap.xml. Each entry is a URL, optionally with the date it last changed.