XML sitemaps: what should be in yours, and what to leave out
A sitemap should list only canonical, indexable pages that return 200. What to include, the size limits, how Google uses lastmod, and how to submit it.
By Sohail Hussain21 November 20265 min read
An XML sitemap should list every URL you want to appear in Google, and nothing else: canonical pages that return a 200 status and are allowed to be indexed, each with an accurate lastmod date. Leave out redirects, noindex pages, 404s, duplicates and URLs with tracking or filter parameters. Submit it once in Search Console and reference it in robots.txt.
A sitemap is a hint, not a command. Google uses it to discover URLs and as a weak signal of which version of a page you prefer, but it still decides what to crawl and index. That is why a clean sitemap matters more than a big one. It is one of the indexing checks in our technical SEO checklist, and a sitemap full of redirects and deleted pages is one of the first things we look for in a technical SEO and performance audit.
Does your site need a sitemap at all?
Google's sitemap overview is candid. You might need one if:
- The site is large, so some pages are easy to miss through links alone.
- The site is new and has few links from other sites.
- You have a lot of video or images, or appear in Google News.
You might not need one if the site has about 500 pages or fewer that you want in search, every important page is reachable through links from the homepage, and you do not rely on image or video results.
That said, WordPress, Shopify, Wix, Webflow and Next.js all generate one with little or no work, and having it switches on the Sitemaps report and the sitemap filter in the Page indexing report. Keep it. Just do not expect a sitemap to get a page indexed that Google has already judged not worth indexing.
What belongs in a sitemap, and what does not?
| URL type | Include? | Reason |
|---|---|---|
| Pages, posts, products and categories you want in search | Yes | This is the whole point |
| The canonical version of each page | Yes | Google treats sitemap inclusion as a canonical signal |
| URLs that 301 or 302 elsewhere | No | List the destination instead |
Pages with noindex | No | Asks Google to index a page that says it should not be |
| URLs blocked in robots.txt | No | Google cannot crawl them anyway |
| 404 and 410 URLs | No | Remove them when the page is deleted |
Parameter variants (?utm_, ?sort=) | No | Duplicates of the canonical |
| Thin archives (tags, empty categories, author pages on one-author blogs) | Usually no | Only if they are useful landing pages |
Paginated pages (/blog/page/2) | Optional | Fine to include; each has its own canonical |
| Images and videos | Optional | Through the image and video sitemap extensions |
The rule behind the table: every URL in the sitemap should pass the same test you would apply when inspecting it in Search Console. Returns 200, is indexable, is its own canonical, and is a page you would be glad to see in results.
Which tags and limits matter?
A minimal valid sitemap:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.com/services/web-design/</loc>
<lastmod>2026-10-12</lastmod>
</url>
<url>
<loc>https://www.example.com/blog/website-cost/</loc>
<lastmod>2026-09-03</lastmod>
</url>
</urlset>
What Google's guide to building a sitemap says about each part, as of October 2026:
locmust be the full, absolute URL. Google crawls it exactly as written, sohttpversushttpsand the trailing slash must match your canonical.lastmodis used only if it is "consistently and verifiably accurate". It should change when the main content, structured data or links change, not when a copyright year or a footer changes. A CMS that sets everylastmodto today's date on each deploy teaches Google to ignore the field.priorityandchangefreqare ignored by Google.- Limits: 50,000 URLs or 50 MB uncompressed per sitemap file. Above that, split it and list the files in a sitemap index.
- Encoding: UTF-8, with characters such as
&escaped as&. - Location: anywhere, but a sitemap at the root can cover the whole site. Without a Search Console submission, a sitemap only covers URLs under its own folder.
Order does not matter. Our XML sitemap generator turns a pasted list of URLs into a valid file if your platform does not produce one.
How should a larger site split its sitemaps?
Once a site has more than a few hundred URLs, split by content type rather than by number: one sitemap for pages, one for blog posts, one for products, one for categories. List them all in a sitemap index and submit the index.
The benefit is diagnostic. In the Page indexing report, the sitemap filter lets you view indexing status for one sitemap at a time. If 95% of pages are indexed but only 40% of products, you know where to look. A single 30,000-URL file hides that.
Sitemaps can also carry extra information: image entries for pages whose images you want found, video entries, and hreflang alternates for multilingual sites. Use the extensions only where they apply. A business site with a gallery page does not need an image sitemap for every logo and icon.
How do you submit and monitor it?
Two ways, and use both:
- In Search Console, open the Sitemaps report, paste the sitemap URL and submit. You need owner permission on the property.
- In robots.txt, add a line such as
Sitemap: https://www.example.com/sitemap_index.xml. This also tells Bing and other search engines where it is. Robots.txt: what to block and what not to covers the rest of that file.
The old method of pinging Google with a sitemap URL stopped working at the end of 2023; Google deprecated the endpoint and requests to it now return a 404.
In the Sitemaps report, each submitted sitemap shows a status. "Success" means Google read it without errors. "Couldn't fetch" means Google could not download it, usually because of a wrong URL, a login, a robots.txt block or a server error. "Has errors" means it was read but some entries are invalid; open it to see which.
Then compare. The "Discovered pages" count should be close to the number of pages you meant to list. In the Page indexing report, filter to "All submitted pages" and look at the reasons for anything not indexed. Submitted URLs sitting under "Page with redirect" or "Excluded by 'noindex' tag" mean the sitemap is listing pages it should not.
If submitted pages are still not being indexed after the sitemap is clean, the cause is elsewhere; why your pages are not indexed covers the other reasons.
Was this guide useful?