Reference guide · technical-seo · Published 2026-08-15 · 3 min read
XML sitemaps: structure, limits and maintenance
XML sitemap guide: url and loc structure, lastmod, the 50k URL and 50MB limits, sitemap index files, and maintenance.
- ·File structure
- ·The limits table
- ·Keeping it updated
What an XML sitemap is
An XML sitemap is a machine-readable list of the URLs on your site that you want search engines to know about and consider for crawling. It does not force a crawl or an index; it is a discovery hint that complements links and complements the crawl of pages bots already find. A sitemap is especially valuable for new pages, pages with few inbound links, and content buried under many navigation levels.
File structure
A sitemap wraps URL entries in a <urlset> root and a namespace. Each entry has a required <loc> containing the absolute URL, an optional <lastmod> for the last modification date, and optional <changefreq> and <priority> hints. The essentials are the root and the <loc>.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/page/</loc>
<lastmod>2026-07-10</lastmod>
</url>
<url>
<loc>https://example.com/other-page/</loc>
</url>
</urlset>
Field notes:
<loc>is required for every<url>and must be a fully qualified, canonical, indexable URL.<lastmod>is optional, should reflect a genuine content change, and should not be re-emitted with today's date on unchanged pages, because fabricated freshness signals degrade trust.<changefreq>and<priority>are hints that search engines can largely ignore, so keep them light or omit them.
Sitemap index files
When a site has many URLs, split the sitemap into child sitemaps and point a sitemap index at them. The index file uses <sitemapindex> with <sitemap> and <loc> entries, one per child file.
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/sitemap-pages.xml</loc>
<lastmod>2026-07-10</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-posts.xml</loc>
</sitemap>
</sitemapindex>
The limits table
Every sitemap and every sitemap index sits under hard structure limits. Enforced values:
| Limit | XML sitemap | Sitemap index |
|---|---|---|
| Maximum URLs | 50,000 | 50,000 child sitemaps |
| Maximum size | 50MB uncompressed | (bound by child sitemap count) |
| Required element | <loc> per <url> | <loc> per <sitemap> |
| File encoding | UTF-8 | UTF-8 |
| Larger sites | Split and gzip | Reference children only |
If a sitemap exceeds 50MB or 50,000 URLs, split it into multiple files, keep each child within limits, and list them in an index. Google generally reads each file again on periodic re-crawls, so the limit is per file, not per site.
image:image only in image sitemaps
The image:image extension element belongs in image-specific sitemaps, where it associates image metadata with a URL. Do not drop image:image tags into an ordinary page sitemap expecting them to rank images. Dedicated image sitemaps use the xmlns:image namespace and are covered in the image sitemap guide.
Keeping the sitemap updated
- Rebuild the sitemap whenever pages are published, removed, or moved, not only on a schedule.
- Include only indexable, canonical URLs; exclude paginated jumbles, search results, and parameter-heavy duplicates.
- Set
<lastmod>from the real content date, and leave it unchanged when nothing moved. - Keep it small enough to fit the limits above, splitting into an index when needed.
- Submit the root sitemap URL in Search Console and in Bing Webmaster Tools, and re-request after edits.
- Watch the submitted status for warnings about orphan URLs or URLs that return 404 or redirect unexpectedly.
Sitemaps are one road into the index. The wider picture of how pages get crawled and stored is in how crawling and indexing work, and robots.txt influences whether pages with a sitemap entry are actually fetched; see the robots.txt guide.