Skip to main content
F
Foglift
All Articles
10 min read

XML Sitemap Validator: How to Check & Fix Your Sitemap for SEO in 2026

A well-formed XML sitemap is the foundation of good SEO. Learn how to validate your sitemap, fix common errors, and optimize for both search engines and AI crawlers.

Validate now: Use our XML Sitemap Validator to check any sitemap for errors, missing fields, and SEO issues — free, no signup required.

What Is an XML Sitemap?

An XML sitemap is a machine-readable file that lists the important URLs on your website. It follows the sitemaps.org protocol and tells search engines (and AI crawlers) which pages exist, when they were last modified, and how important they are relative to each other.

Think of it as a table of contents for your website. Without one, search engines rely solely on crawling links — which means orphaned pages (those with no internal links) may never be discovered. For sites with 50+ pages, a sitemap is essential.

XML Sitemap Structure & Required Fields

A valid XML sitemap must follow this structure:

<?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-03-15</lastmod>
    <changefreq>weekly</changefreq>
    <priority>0.8</priority>
  </url>
</urlset>
<loc>
Required

The full URL of the page. Must be absolute (start with https://).

<lastmod>
Optional

Last modification date in W3C datetime format (YYYY-MM-DD). Google uses this to prioritize crawling.

<changefreq>
Optional

How often the page changes: always, hourly, daily, weekly, monthly, yearly, never. Mostly ignored by Google in 2026.

<priority>
Optional

Relative importance (0.0 to 1.0). Only meaningful within your own site. Default is 0.5.

Common XML Sitemap Errors

Critical

Missing XML namespace

Add xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" to the <urlset> tag. Without this, search engines may not parse the file.

Critical

Relative URLs in <loc>

All URLs must be absolute (https://example.com/page, not /page). Relative URLs cause parsing failures.

Warning

Invalid lastmod format

Use W3C datetime: YYYY-MM-DD or YYYY-MM-DDThh:mm:ss+00:00. Common mistake: using MM/DD/YYYY format.

Warning

URLs returning 404 or 301

Remove dead URLs and redirects from your sitemap. Only include canonical, 200-status URLs.

Warning

Sitemap too large

Max 50,000 URLs or 50MB per file. Split into multiple sitemaps and use a sitemap index file.

Warning

Including noindex pages

Don't include pages with noindex meta tags. This sends conflicting signals to search engines.

Info

Wrong encoding

Use UTF-8 encoding. Declare it in the XML header: <?xml version="1.0" encoding="UTF-8"?>

Sitemap Index Files

For large websites, use a sitemap index that points to individual sitemaps:

<?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-03-15</lastmod>
  </sitemap>
  <sitemap>
    <loc>https://example.com/sitemap-blog.xml</loc>
    <lastmod>2026-03-14</lastmod>
  </sitemap>
</sitemapindex>

Sitemaps and AI Crawlers

AI crawlers like GPTBot, ClaudeBot, and PerplexityBot use sitemaps to discover content — just like traditional search engines. A well-maintained sitemap increases your chances of being cited in AI-generated answers (GEO). Key tips:

  • Include your most comprehensive, authoritative pages
  • Keep <lastmod> accurate — AI crawlers prioritize fresh content
  • Reference your sitemap in robots.txt: Sitemap: https://example.com/sitemap.xml
  • Use Foglift's Robots.txt Tester to verify AI crawlers can access your sitemap

Frequently Asked Questions

Do I need an XML sitemap?

If your site has more than 50 pages, is new, or has orphan pages (not linked internally), yes. Google's own docs say sitemaps are 'helpful for most sites.' For SEO and GEO, it's a best practice to always have one.

Where should my sitemap be located?

Convention is /sitemap.xml at your domain root (e.g., https://example.com/sitemap.xml). You should also reference it in your robots.txt file with a Sitemap: directive. Submit it to Google Search Console and Bing Webmaster Tools for faster discovery.

How often should I update my sitemap?

Update whenever content changes — adding new pages, removing old ones, or significantly modifying existing content. If your CMS auto-generates sitemaps (WordPress, Next.js, etc.), this happens automatically. Just verify the output is valid.

Can a sitemap hurt my SEO?

A broken or misconfigured sitemap can hurt — listing 404 pages, noindex pages, or sending conflicting signals wastes crawl budget and confuses search engines. That's why validation is important. Use our free validator to catch issues before they affect your rankings.

Related Tools & Guides

Check your entire website's SEO health

Our full website scan checks sitemap, robots.txt, meta tags, performance, security, and more — free.

Scan Your Website FreeValidate Your Sitemap

Free tool

Check your website's SEO + GEO score

Scan any URL in 30 seconds. See scores for SEO, AI search readiness, performance, security, and accessibility.

Scan Your Site Free

No signup. 5 free scans/day. Results in 30 seconds.