The sitemap.xml file is the formal contract between a website and search engines — declaring which URLs the site owner wants indexed, when each was last modified, and how often content changes. A free sitemap validator parses this XML against the official Sitemaps.org Protocol 0.9 (introduced June 2005 by Google, Ask, MSN, and Yahoo!), checks for well-formedness, validates each URL against Google’s 2,048-character hard limit and ISO 8601 lastmod datetime format, and produces a structured error report. The Sitemaps.org protocol is XML 1.0 namespaces plus a flat list of entries with mandatory and optional , , .

Table of Contents

  1. What a Sitemap Validator Does
  2. The Sitemaps.org Protocol 0.9 Specification
  3. XML Schema Validation: Required and Optional Elements
  4. Common Sitemap Errors and Their Causes
  5. Multi-Sitemap Patterns: The sitemap_index.xml Pattern
  6. Submitting a Sitemap to Google Search Console and Bing
  7. Beyond Standard Sitemap: Image, Video, News, and Hreflang Extensions

What a Sitemap Validator Does

A sitemap validator takes a sitemap.xml file as input (either via drag-and-drop, paste-text-area, or fetch-from-URL), parses it as XML against the Sitemaps.org Protocol 0.9 schema, and produces one of four outcomes:

  1. PASS: Well-formed XML, valid namespace, every is a valid URL, every is ISO 8601 datetime, all 50,000-URL and 50-MB limits respected.
  2. WARN: Valid XML but issues like non-canonical pagination, missing , or unusual values.
  3. ERROR: Invalid XML, missing namespace, broken URLs, or sizes exceeding limits.
  4. INFO: Valid XML but missing recommended elements (, ).

Validators should additionally check the following seven common failure modes:

  • Missing XML declaration (<?xml version="1.0" encoding="UTF-8"?>)
  • Missing urlset envelope (the root with the namespace)
  • Invalid encoding (most parses expect UTF-8)
  • Relative URLs in (must be absolute)
  • Duplicate (Google will silently dedupe; report as warning)
  • Non-HTTP schemes (e.g., file://, ftp://)
  • >50,000 URLs or >50 MB uncompressed (must split via sitemap_index.xml)

The Sitemaps.org Protocol 0.9 Specification

Sitemaps.org Protocol 0.9 was published June 2005 (initial) and revised minor revisions through 2017. The full protocol requires the following XML structure:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/page-1</loc>
    <lastmod>2026-07-19</lastmod>
    <changefreq>weekly</changefreq>
    <priority>0.8</priority>
  </url>
  <url>
    <loc>https://example.com/page-2</loc>
  </url>
</urlset>

Mandatory elements:

  • <?xml version="1.0" encoding="UTF-8"?> — XML declaration
  • <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> — root envelope with namespace
  • At least one <url> entry containing <loc> (the page URL)

Optional elements per <url>:

  • <lastmod> — ISO 8601 datetime of last modification
  • <changefreq>always|hourly|daily|weekly|monthly|yearly|never
  • <priority>0.0 to 1.0 (default 0.5, relative to other pages in the sitemap)

XML Schema Validation: Required and Optional Elements

A standard validator checks each entry against the schema:

def validate_url_entry(entry):
    loc = entry.find('loc')
    if loc is None or not loc.text.strip():
        return ERROR, "<loc> required and must contain a URL"
    if not loc.text.startswith(('http://', 'https://')):
        return ERROR, "<loc> must be absolute HTTP/HTTPS URL"
    if len(loc.text) > 2048:
        return ERROR, "<loc> exceeds 2,048 character Google limit"
    
    lastmod = entry.find('lastmod')
    if lastmod is not None:
        try:
            from datetime import datetime
            datetime.fromisoformat(lastmod.text.replace('Z', '+00:00'))
        except ValueError:
            return ERROR, "<lastmod> not ISO 8601 datetime"
    
    changefreq = entry.find('changefreq')
    if changefreq is not None and changefreq.text not in ('always', 'hourly', 'daily', 'weekly', 'monthly', 'yearly', 'never'):
        return ERROR, "<changefreq> must be one of: always|hourly|daily|weekly|monthly|yearly|never"
    
    priority = entry.find('priority')
    if priority is not None:
        try:
            v = float(priority.text)
            if not (0.0 <= v <= 1.0):
                return ERROR, "<priority> must be between 0.0 and 1.0"
        except ValueError:
            return ERROR, "<priority> must be numeric"
    
    return PASS, "valid"

Common Sitemap Errors and Their Causes

Error Cause Fix
xmlns missing Wrong namespace or copy-paste error Use exact xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
Relative URL in Most CMS-generated sitemaps use relative URLs Force plugin to emit absolute URLs with base URL prefix
Lastmod in YYYY-MM-DD HH:MM:SS Wrong ISO 8601 separator Use YYYY-MM-DD (date-only) or RFC 3339 with timezone like 2026-07-19T08:30:00+00:00
above 1.0 Decimals or negative Clamp to [0.0, 1.0]
>50,000 URLs Misconfigured CMS Split into multiple sitemaps + create sitemap_index.xml
503 errors when fetched by Google Server rate-limiting Increase sitemap serving rate limits or move to CDN
doesn't match actual content mtime Hardcoded values Wire sitemap generation to file-system mtime or DB row.updated_at

Multi-Sitemap Patterns: The sitemap_index.xml Pattern

For sites with >50,000 URLs OR >50 MB uncompressed, the protocol requires splitting into multiple sitemaps and creating a sitemap_index.xml that references them:

<?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-07-19</lastmod>
  </sitemap>
  <sitemap>
    <loc>https://example.com/sitemap-2.xml</loc>
    <lastmod>2026-07-18</lastmod>
  </sitemap>
</sitemapindex>

Limits at the index level: 50,000 sitemap references max, ~50 MB uncompressed. A site can have multiple sitemap_index.xml files if even this isn't enough.

Common services creating multi-sitemap setups: e-commerce with >50k products, news aggregators, large SaaS platforms with millions of pages.

Submitting a Sitemap to Google Search Console and Bing

After validation, the sitemap must be submitted to search engines:

  1. Google Search Console: https://search.google.com/search-console → Sitemaps → Add new sitemap → Enter https://example.com/sitemap.xml (or sitemap_index.xml) → Submit.
  2. Bing Webmaster Tools: https://www.bing.com/webmasters → Sitemaps → Submit sitemap.
  3. robots.txt (recommended): Add Sitemap: https://example.com/sitemap.xml line to /robots.txt.
  4. Yandex Webmaster Tools: https://webmaster.yandex.com → Indexing → Sitemap files.

Submitting does NOT guarantee indexation or ranking — just makes the URLs "discoverable" via the sitemap pipeline. Google still needs to crawl and index before ranking can begin.

Beyond Standard Sitemap: Image, Video, News, and Hreflang Extensions

The Sitemaps.org Protocol 0.9 has XSD extensions covering specific content types:

  • Image sitemap: <image:image><image:loc>...</image:loc></image:image> for image-rich pages (Google Image Search).
  • Video sitemap: <video:video><video:thumbnail_loc>...</video:thumbnail_loc></video:video> for video content (Google Video Search).
  • News sitemap: For news sites (<2-day-old content), speed up Google News indexing.
  • Hreflang sitemap: <xhtml:link rel="alternate" hreflang="..." href="..." /> for multilingual sites (auto-detected by Google).

Example image sitemap entry:

<url>
  <loc>https://example.com/article-1</loc>
  <image:image>
    <image:loc>https://example.com/image-1.jpg</image:loc>
    <image:title>Image title text</image:title>
    <image:caption>Optional caption text</image:caption>
  </image:image>
</url>

Validators should optionally check these extensions and report missing coverage for image-rich pages.

People Also Ask

A sitemap validator parses an uploaded sitemap.xml file against the Sitemaps.org Protocol 0.9 schema, checks XML well-formedness, validates each `<loc>` URL (must be absolute HTTP/HTTPS, ≤2,048 chars), validates `<lastmod>` as ISO 8601 datetime, validates `<changefreq>` enumeration (`always|hourly|daily|weekly|monthly|yearly|never`), validates `<priority>` numeric range (0.0 to 1.0), and reports errors with line numbers + suggested fixes. Validators also check Google’s 50,000-URL and 50-MB limits.
Last updated: July 19, 2026