Quick answer: An XML sitemap should list only the canonical, indexable URLs that return a 200 status code, with an accurate lastmod date for each. Keep each file under 50,000 URLs and 50 MB uncompressed, use a sitemap index for larger sites, and submit it in Search Console and in robots.txt. Google ignores the priority and changefreq values, so do not spend time on them.
An XML sitemap does not make pages rank. It helps search engines discover URLs and understand which ones you consider important and when they changed. On a small, well-linked site, Google would find everything anyway. On a large or fast-changing site, a clean sitemap can be the difference between new pages indexed in days and new pages ignored for weeks.
Most sitemap problems I find in audits are not missing sitemaps. They are sitemaps full of URLs that should not be there.
What belongs in an XML sitemap
| Include | Exclude |
|---|---|
| Canonical URLs you want indexed | URLs that canonicalize to another URL |
| Pages returning 200 | Redirects (3xx) and errors (4xx, 5xx) |
| Indexable pages | Pages with noindex |
| Pages allowed in robots.txt | URLs blocked by robots.txt |
| One version of each URL | Parameter, session and filter variations |
Every URL in the sitemap is a statement: “this is a page I want in Google’s index.” When the sitemap contradicts other signals, such as listing a URL that has noindex, it weakens your other statements and creates noise in Search Console.
Sitemap size limits
- Up to 50,000 URLs per sitemap file.
- Up to 50 MB uncompressed per file. You can gzip sitemaps to save bandwidth, but the limit applies to the uncompressed size.
- Larger sites should split into multiple sitemaps and list them in a sitemap index file.
Splitting by type, such as products, categories, blog posts and location pages, also makes Search Console reporting more useful. You can see at a glance which section has indexing problems.
lastmod, priority and changefreq
- lastmod: Google uses it if it is consistently and verifiably accurate. Update it only when the main content changes, not when a footer year or sidebar widget updates.
- priority: ignored by Google.
- changefreq: ignored by Google.
A sitemap where every lastmod equals today’s date teaches Google that the value is meaningless.
How to submit your sitemap
- Search Console: open Sitemaps, enter the sitemap or index URL and submit. This also gives you a report on processing.
- robots.txt: add a line such as
Sitemap: https://www.example.com/sitemap_index.xml. Other search engines read this too.
Google retired the old sitemap “ping” endpoint in 2023. Submitting through Search Console and robots.txt, plus accurate lastmod values, is now the standard approach.
Special sitemap types
- Image sitemaps help Google find images that are loaded in ways it might miss.
- Video sitemaps provide video details such as title, thumbnail and duration.
- News sitemaps are for publishers in Google News and should only include recent articles.
- Hreflang in sitemaps is an alternative to HTML tags for international sites. See my hreflang guide.
How to audit your sitemap
- Crawl every URL in the sitemap and check the status code, canonical tag and robots directives.
- Remove anything that is not 200, self-canonical and indexable.
- Compare the sitemap with a crawl of the site. Pages in the crawl but missing from the sitemap may be forgotten. Pages in the sitemap but not reachable by links are orphans.
- In Search Console, open the Page indexing report filtered to the sitemap to see which submitted URLs are not indexed and why.
Submitted URLs stuck as “Crawled, currently not indexed” usually point to a quality or duplication issue, not a sitemap problem. My guide to crawled, currently not indexed explains how to work through them.
Sitemaps in WordPress and Shopify
WordPress has a built-in sitemap, and SEO plugins such as Yoast or Rank Math replace it with their own. Use one, not both. Check that the plugin excludes tag archives, attachment pages and other thin pages you do not want indexed. Shopify generates sitemaps automatically; your job is to keep junk pages out of them through noindex and good collection structure.
Sitemaps also matter during migrations. Keep the old sitemap submitted for a while after redirects go live so Google recrawls the old URLs and sees the redirects. That step is in my website migration checklist.
If your sitemap and indexing reports disagree and you cannot see why, a review of crawl and index signals is part of my technical SEO service.
Frequently asked questions
Does a sitemap guarantee indexing?
No. A sitemap helps discovery. Google still decides whether each page is worth indexing.
Does every website need an XML sitemap?
Small, well-linked sites can do without one, but there is no downside to having a clean sitemap, and it gives you better Search Console reporting.
Should I include images in my sitemap?
Only if Google might miss them otherwise, for example images loaded by JavaScript. Images in normal HTML are found during crawling.
How often should my sitemap update?
Automatically, whenever pages are added, removed or meaningfully changed. Most CMS sitemap tools do this for you.
Sources: Google Search Central: Build and submit a sitemap; Google Search Central Blog: Sitemaps ping endpoint is going away.




