Skip to main content
XMLDir

Search 309 pages — tools, formats, elements, namespaces, directory, comparisons, XPath, datatypes, glossary, parse errors, schema errors, use cases, blog and product.

Sitemap index

<sitemap>

One child sitemap in an index: a required <loc> pointing at the sitemap file, and an optional <lastmod> for it.

Each <sitemap> names one sitemap file. It has the same two children an index entry can carry — <loc> and <lastmod> — and nothing else; changefreq and priority belong to <url> and are not permitted here.

The <lastmod> here is about the sitemap file rather than any page inside it, which is what makes it useful: a crawler that has seen this index before can skip every child whose lastmod has not moved.

Cardinality and constraints

One or more per index, up to 50,000.

  • Exactly one <loc>; <lastmod> optional; nothing else is permitted.
  • The <loc> must point at a sitemap, never at another index.
  • Child sitemaps should live on the same host as the index.

What our validator does

Counted, and each entry is checked for a <loc>; entries missing one are reported as an error.

Broken and fixed

Both documents below are well-formed XML — that is the point of this corpus — and both are run through the validator on every test run. The verdicts here are what it returned, not what we expect it to.

broken
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <lastmod>2026-08-10</lastmod>
  </sitemap>
</sitemapindex>
1 child sitemap(s) are missing a <loc>.
fixed
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://example.com/sitemap-1.xml</loc>
    <lastmod>2026-08-10</lastmod>
  </sitemap>
</sitemapindex>
No errors. Warnings may remain — a conforming feed can still be missing a self link — but nothing here is wrong.

Get started

Bring order to the XML your team can't afford to ignore.

Create a free account and get a private workspace to search, validate, diff, and monitor your XML feeds, sitemaps, schemas, and vendor integrations.