An XML sitemap is a file that lists the important URLs on your site so search engines can find and crawl them efficiently. It is one of the simplest, most reliable technical-SEO wins: a well-maintained sitemap helps Google discover new and updated pages faster, especially on large sites or ones with weak internal linking. This guide covers what a sitemap is, what to include, and how to create, validate and submit one.
What an XML sitemap does
Search engines find pages primarily by following links. That works well for well-linked sites, but pages that are new, deep in the structure, or poorly linked can be missed or crawled slowly. An XML sitemap is a direct list you hand to search engines saying “here are the URLs I care about.” It does not guarantee indexing, Google still decides what to index, but it dramatically improves discovery, which is the necessary first step.
What a sitemap contains
At its core, a sitemap is an XML file with a <urlset> containing one <url> entry per page. Each entry has a <loc> (the absolute URL) and can optionally include:
<lastmod>, when the page was last changed, useful for signalling freshness.<changefreq>and<priority>, hints about update frequency and importance, though Google largely ignores these now.
The most valuable field by far is an accurate lastmod: keep it honest and it helps Google prioritise recrawling pages that actually changed.
What to include, and what to leave out
A sitemap should list the canonical, indexable URLs you want in search, and nothing else. Common mistakes come from including URLs that should not be there:
| Include | Exclude |
|---|---|
| Canonical, indexable pages | Noindexed pages |
| Pages that return 200 OK | Redirects (3xx) and errors (4xx/5xx) |
| The version you want to rank | Non-canonical duplicates and parameter URLs |
| Important content and category pages | Pages blocked by robots.txt |
A sitemap full of redirects, errors or noindexed URLs sends mixed signals and wastes crawl budget. Keep it clean.
Size limits and sitemap indexes
A single sitemap can hold up to 50,000 URLs and must be under 50 MB uncompressed. Large sites split their URLs across multiple sitemaps and tie them together with a sitemap index, a master file that lists the individual sitemaps. Splitting by section (products, blog, categories) also makes it easier to spot indexing problems: if one section’s sitemap shows poor coverage in Search Console, you know where to look.
How to create an XML sitemap
You have three routes depending on your setup:
- A plugin or platform feature. WordPress SEO plugins and most modern platforms generate and update a sitemap automatically, this is the best option for a live site because it stays current.
- A generator tool. For a static site or a one-off, paste your URLs into our free XML sitemap generator and get a valid
sitemap.xmlto upload. - A crawler. Crawl your site and export the discovered URLs into a sitemap.
Validate and submit it
Before you rely on a sitemap, confirm it is valid: well-formed XML, absolute URLs, no errors. Run it through our sitemap validator to catch broken <loc> entries, invalid priorities and malformed dates. Then submit it in Google Search Console under Sitemaps, and add a Sitemap: line to your robots.txt so every crawler can find it. After submission, watch the Coverage and Sitemaps reports to see how many URLs Google actually indexes versus how many you submitted, a big gap points to quality or crawlability problems.
Keep it current
A stale sitemap is a missed opportunity. The best sitemaps update automatically as you publish, update or remove pages, so lastmod stays accurate and new pages appear promptly. If you manage yours manually, make regenerating it part of your publishing checklist, and periodically extract and review the URLs it contains, our sitemap URL extractor pulls a clean list you can audit.
The takeaway
An XML sitemap is a clean list of your canonical, indexable URLs that helps search engines discover and recrawl your content, especially on large or loosely-linked sites. Include only good URLs, keep lastmod honest, validate before submitting, and add it to Search Console and robots.txt. Create yours with the XML sitemap generator, check it with the validator, and see the rest of our free SEO tools.