SEO
XML sitemap: what goes in, what stays out, how to check it
The essentials
- The sitemap is the list of pages you want in search engines. It helps them find pages; it does not guarantee indexing.
- Only pages that return 200, are indexable and are their own canonical belong in it.
- Each file takes up to 50,000 URLs and 50 MB. Past that, split it with a sitemap index.
- Declare it in robots.txt with a
Sitemap:line and submit it in Search Console.
What it is
An XML file that lists your site’s addresses, each in a <loc> tag. Search engines read it to discover new pages and see which ones changed, especially pages with few internal links.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://yoursite.com/</loc>
<lastmod>2026-11-20</lastmod>
</url>
<url>
<loc>https://yoursite.com/services/audit</loc>
<lastmod>2026-11-14</lastmod>
</url>
</urlset>What goes in and what does not
| Yes | No |
|---|---|
| Pages that return 200 | Addresses that redirect or return 404 |
| Indexable pages | Pages with noindex |
| The canonical version of each page | Duplicates, filter or campaign parameters |
| Full addresses with https | Relative paths or http addresses |
| Addresses on your own domain | Addresses on other domains |
A sitemap with errors does not penalize the site, but it makes the list less trustworthy: if half the addresses fail, the search engine pays less attention to the rest.
lastmod, priority and changefreq
- lastmod is the date the content last really changed. Google uses it when it is reliable; if every page gets today’s date every day, it stops believing it.
- priority and changefreq are ignored by Google. No need to fill them in.
Limits and indexes
Each sitemap takes 50,000 URLs and 50 MB uncompressed. A large site publishes several plus an index that groups them; the index is what you declare.
<?xml version="1.0" encoding="UTF-8"?> <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <sitemap><loc>https://yoursite.com/sitemap-pages.xml</loc></sitemap> <sitemap><loc>https://yoursite.com/sitemap-products.xml</loc></sitemap> </sitemapindex>
How to get it found
- Add
Sitemap: https://yoursite.com/sitemap.xmlto your robots.txt. Every search engine and many AI bots read it. - Submit it in Google Search Console, under Sitemaps. There you see how many addresses were read and whether there were errors.
- Make sure the address returns 200 with XML, not an HTML page.
Check it
Check your site’s sitemap
Common mistakes
- A plugin that lists tags, authors and attachments you do not want indexed.
- Addresses with http or without the trailing slash that then redirect: the search engine pays a redirect for each one.
- A sitemap from the staging site with another domain.
- Not updating it when pages are deleted, so they sit in the list returning 404.