An XML sitemap is a file that lists the pages on your site you want search engines to find, together with the date each page last changed in a meaningful way. Google treats it as a hint: it helps Googlebot discover URLs faster, especially on new sites with few links pointing in, but it never forces a page into the index.
What is an XML sitemap?
It is a plain XML file, normally at https://yoursite.com/sitemap.xml, with one <url> entry per page. Each entry holds the page address in <loc> and, optionally, the last real change in <lastmod>. Larger sites split their URLs over several sitemaps and list those in a sitemap index file.
A minimal sitemap looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/pricing/</loc>
<lastmod>2026-10-20</lastmod>
</url>
</urlset>
Why does a sitemap matter for SEO?
Google finds most pages by following links. A sitemap fills the gaps. Here is when it pays off most:
- New sites with almost no backlinks, where Googlebot has few ways in.
- Large sites with deep pages that sit five or more clicks from the homepage.
- Sites that change daily, where an accurate
<lastmod>tells Google which pages to recrawl first. - Pages with images or video you want in Google Images or video results (see image sitemaps).
A small site with good internal links gets indexed without one. It still costs you nothing, and the Sitemaps report in Search Console becomes a free indexing checklist.
Which sitemap rules does Google actually follow?
Google’s documentation is short and specific. These are the rules that matter in practice:
| Rule | What Google says |
|---|---|
| Size | One sitemap holds at most 50,000 URLs or 50 MB uncompressed. Split bigger sites and use an index file. |
| URLs | Use full, absolute URLs (https://example.com/page/, never /page/). |
| Which URLs | Only the pages you want in search results: the canonical version, status 200, not blocked, not noindex. |
<lastmod> |
Used only if it is consistently accurate: the last real content change, not today’s date on every page. |
<priority>, <changefreq> |
Ignored by Google. Leave them out. |
| Location | The site root is best, because a sitemap only covers URLs at or below its own folder. |
The ping URL that sitemap plugins used to call was retired by Google in 2023, so submission now runs through Search Console, robots.txt or the Search Console API.
How do you create and submit a sitemap, step by step?
- Generate it from your CMS or framework. WordPress (Yoast, Rank Math or the built-in
wp-sitemap.xml), Shopify, Webflow, Wix and Tilda create one automatically. Static sites use a build plugin such as@astrojs/sitemapornext-sitemap. Hand-written sitemaps go stale within weeks. - Strip the URLs that should not be there. Redirects, 404s,
noindexpages, filtered or parameter URLs, thank-you pages and duplicates all go. Every URL in the file should return 200 and point its canonical tag at itself (see canonical tags). - Make
<lastmod>honest. Tie it to the real content change date stored in your CMS. If your setup can only print the build date for every page, drop<lastmod>entirely. - Split big sites. Over 50,000 URLs, create one sitemap per section (posts, products, categories) and list them in
sitemap_index.xml. Per-section files also make indexing problems easier to spot. - Name it in robots.txt. Add one line, anywhere in the file:
Sitemap: https://example.com/sitemap.xml. Bing, Google and other crawlers read it there (see robots.txt and noindex). - Submit it in Search Console. Open Indexing → Sitemaps, paste the URL and press Submit. Do the same in Bing Webmaster Tools, which also feeds Microsoft Copilot.
- Check it again after big changes. A site migration, a new section or a CMS switch is the moment sitemaps break.
How do you measure whether your sitemap works?
The Sitemaps report in Google Search Console shows whether Google could read the file, when it last did, and how many URLs it discovered. Click through to the Page indexing report filtered on that sitemap to see how many of the submitted URLs are indexed and why the rest are not.
Three numbers tell you the story:
- Status “Success” and a recent “Last read” date: Google fetches the file.
- Discovered URLs equal to the URLs you listed: no parsing errors.
- Indexed share of submitted URLs: on a healthy site most of them. A low share points to quality or duplication problems, which the crawl and indexing errors method covers.
What mistakes should you avoid?
- Listing URLs you do not want indexed. Redirects,
noindexpages and duplicates in a sitemap send Google mixed signals and clutter your reports. - Fake freshness. Setting
<lastmod>to today on every page teaches Google to ignore your dates altogether. - Spending time on priority and changefreq. Google ignores both.
- Blocking the sitemap in robots.txt or serving it behind a login or firewall rule that stops Googlebot.
- Expecting a sitemap to rescue weak pages. It speeds up discovery. Whether a page gets indexed and ranks depends on its content and links.
Where can you learn more?
The free digital marketing module of the Fe/male Switch startup school walks through setting up Search Console and a sitemap for a brand-new startup site. Next steps on SEO100: make sure your robots.txt points to the sitemap, then follow up on the URLs Google leaves out in the page indexing report.