What a sitemap is actually for
An XML sitemap is a file that lists every URL on your site you want search engines to know about, along with metadata about each one. It doesn't force Google to rank a page, and it doesn't replace internal linking — but it does help search engines discover pages faster, especially on large sites, new sites with few backlinks, or sites with pages that are hard to reach through normal navigation.
For small sites this matters less. For sites with hundreds or thousands of URLs, it's often the difference between a new page getting crawled within a day versus sitting undiscovered for weeks.
The basic structure
A sitemap is XML, not HTML, and follows a fixed protocol. At minimum, each entry needs a <url> block containing a <loc> tag. Everything else is optional metadata that helps search engines prioritize crawling, not a set of instructions they're obligated to follow.
<url>
<loc>https://example.com/products/widget</loc>
<lastmod>2026-06-15</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
What each field actually means
<loc>— the full, absolute URL of the page. This is the only required field.<lastmod>— the date the page was last meaningfully updated. Search engines use this as a signal for re-crawl priority, so it should reflect real content changes, not be auto-updated on every deploy.<changefreq>— a hint (not a guarantee) about how often the page changes:daily,weekly,monthly, etc. Google treats this as a loose suggestion rather than a rule.<priority>— a relative value from 0.0 to 1.0 indicating how important a page is compared to other pages on your own site. It says nothing about importance compared to other sites, and inflating every page to 1.0 defeats its purpose entirely.
Common sitemap mistakes
- Including non-canonical, redirected, or noindexed URLs — a sitemap should only list pages you actually want indexed; mixing in redirects or duplicates sends confusing signals
- A stale
lastmodthat never changes — if every page shows the same date regardless of edits, search engines learn to ignore the field - One giant sitemap for a huge site — sitemaps are capped at 50,000 URLs and 50MB uncompressed; larger sites need a sitemap index file referencing multiple sitemaps
- Forgetting to reference it in
robots.txtor submit it in Google Search Console, which means it may never get picked up at all - Treating
priorityas a ranking factor — it only affects how your own pages are weighted against each other, not your position in search results
How to generate one correctly
- List the URLs you want indexed — typically your canonical, indexable pages only.
- Set realistic
lastmod,changefreq, andpriorityvalues per page rather than defaulting everything to the same values. - Validate the XML structure against the sitemap protocol before submitting.
- Submit it in Google Search Console and reference it in
robots.txtso it's easy for crawlers to find. - Re-generate it whenever the site structure changes — new sections, deleted pages, or major content updates should all be reflected.
Wrapping up
A sitemap is a small file with an outsized effect on how quickly search engines discover and re-crawl your content. Generate a valid one with proper metadata rather than hand-writing XML, and keep it in sync as pages are added, updated, or removed.