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.

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:

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:

LimitXML sitemapSitemap index
Maximum URLs50,00050,000 child sitemaps
Maximum size50MB uncompressed(bound by child sitemap count)
Required element<loc> per <url><loc> per <sitemap>
File encodingUTF-8UTF-8
Larger sitesSplit and gzipReference 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

  1. Rebuild the sitemap whenever pages are published, removed, or moved, not only on a schedule.
  2. Include only indexable, canonical URLs; exclude paginated jumbles, search results, and parameter-heavy duplicates.
  3. Set <lastmod> from the real content date, and leave it unchanged when nothing moved.
  4. Keep it small enough to fit the limits above, splitting into an index when needed.
  5. Submit the root sitemap URL in Search Console and in Bing Webmaster Tools, and re-request after edits.
  6. 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.

Need a website built, fixed, optimised, migrated or replaced?

This technical resource is written by CSMBAC, a small design and development studio. If you would rather hand the problem to a professional, the website service page explains how we build enquiry-ready websites.

Explore website services