← Back to blog
Technical SEO

How to Validate Your XML Sitemap (and Fix the Errors Google Actually Cares About)

A sitemap that Google can't parse is worse than no sitemap at all — it can quietly stop new pages from getting discovered for weeks. Here's what a validator actually checks, the errors that matter, and how to fix each one.

By Rajhussain Kanani6 min read

What an XML sitemap actually does

An XML sitemap is a file — usually at yoursite.com/sitemap.xml — that lists every URL you want search engines to know about. It doesn't force Google to rank those pages, and it doesn't even guarantee they get crawled. What it does is remove the guesswork: instead of Google finding your pages by following links around your site (which can take a while, especially for a new page with no internal links pointing to it yet), you hand it the full list directly.

That matters most in three situations: a brand-new site with little existing link equity, a large site where some pages are buried deep in the navigation, and any site that publishes new pages regularly and wants them discovered fast.

What a sitemap validator checks

"Validating" a sitemap isn't just checking that the XML doesn't have a typo. A real validator checks:

  • Valid XML syntax — unclosed tags, bad character encoding, or malformed structure will make Google reject the whole file, not just the broken line.
  • Correct namespace declaration — every sitemap needs the right xmlns attribute or search engines won't recognize it as a sitemap at all.
  • Absolute URLs — every <loc> entry must be a full URL (https://example.com/page), not a relative path.
  • Size limits — a single sitemap file can't exceed 50,000 URLs or 50MB uncompressed. Bigger sites need a sitemap index file that points to multiple sitemap files.
  • Correct lastmod format — must be a valid W3C datetime (YYYY-MM-DD at minimum), or Google ignores the field entirely.
  • Live URLs — every URL listed should actually return a 200 status. Sitemaps full of 404s or old redirects waste crawl budget and signal poor maintenance.
  • No conflicting signals — a URL in your sitemap that's also blocked by robots.txt or has a noindex tag is telling Google two contradictory things at once.

A broken sitemap versus a fixed one

Most sitemap problems are easier to spot side by side than described in a bullet list. Here's a sitemap with three of the mistakes covered below, all in a few lines:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>/blog/first-post</loc>
    <lastmod>last week</lastmod>
  </url>
  <url>
    <loc>https://example.com/old-page</loc>
  </url>
</urlset>

Three separate problems in that snippet: the first <loc> is a relative path, not an absolute URL; its <lastmod> is human-readable text ("last week") instead of a valid date, so Google silently ignores it; and the second URL points at a completely different domain than the one this sitemap is actually submitted for, which most validators — and Google itself — will flag as a cross-domain mismatch. Here's the same two entries fixed:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/blog/first-post</loc>
    <lastmod>2026-09-06</lastmod>
  </url>
  <url>
    <loc>https://example.com/current-page</loc>
    <lastmod>2026-09-04</lastmod>
  </url>
</urlset>

Both URLs are now absolute, on the correct domain, with a real ISO-8601 date. That's the entire fix — no restructuring, just getting three fields into the shape Google's parser actually expects.

Run all of these checks at once with CheckSEO's Sitemap Validator — paste your sitemap URL, get every error flagged in one pass. No signup.

Open the Sitemap Validator

The 7 most common sitemap errors (and how to fix them)

1

Relative URLs instead of absolute

/blog/post-1 instead of https://example.com/blog/post-1. Google's spec requires absolute URLs — a relative path gets silently skipped. Fix: most sitemap generators do this correctly by default; if you hand-rolled your sitemap or a plugin misconfigured the site URL, regenerate it with the full domain included.

2

URLs blocked by robots.txt

Listing a URL in your sitemap while also disallowing it in robots.txt sends a mixed signal, and Google generally won't crawl it. Fix: check the URL against your robots.txt rules — if the page should be indexed, remove the disallow; if it shouldn't be, remove it from the sitemap instead.

3

Non-200 status codes

URLs that 404, redirect (301/302), or return a server error waste crawl budget and make the sitemap look unmaintained. Fix: remove dead URLs and update any that have moved to their final destination — don't list the redirect source.

4

Missing or malformed lastmod

An invalid date format doesn't break the sitemap, but Google just ignores the field — meaning it can't prioritize recrawling your most recently updated pages. Fix: use ISO 8601 format (2026-09-06 or with a time component), and only update it when the page's actual content changes, not on every deploy.

5

Exceeding the 50,000 URL / 50MB limit

A single sitemap file over either limit gets rejected outright. Fix: split into multiple sitemap files (e.g. by content type or date range) and reference them all from one sitemap index file.

6

Sitemap not referenced in robots.txt

Not strictly an "error," but a missed opportunity — adding Sitemap: https://example.com/sitemap.xml to robots.txt is the most reliable way to make sure every crawler finds it, not just the ones you've manually submitted it to. Fix: add the line; it takes one edit.

7

Orphaned or duplicate URLs

The same URL listed twice (often with different lastmod values from different plugins fighting each other) confuses prioritization signals. Fix: deduplicate the list — most CMS sitemap plugins conflict when you run more than one at once, so check for that first.

What a sitemap index actually looks like

Once a site outgrows the 50,000-URL ceiling — or just for organizational clarity — the fix is a sitemap index: a small file that lists other sitemap files instead of URLs directly. Splitting by content type (posts, products, categories) rather than an arbitrary chunk size also makes it easier to spot which section of the site has a problem when Search Console reports an error:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://example.com/sitemap-posts.xml</loc>
    <lastmod>2026-09-06</lastmod>
  </sitemap>
  <sitemap>
    <loc>https://example.com/sitemap-products.xml</loc>
    <lastmod>2026-09-01</lastmod>
  </sitemap>
</sitemapindex>

Google reads the index, then crawls each referenced sitemap on its own schedule — a large product catalog can get recrawled more often than a static set of category pages, for example, without needing to touch the other file at all.

How Google actually uses your sitemap after you submit it

Submitting a sitemap doesn't trigger an immediate crawl of every URL in it. What actually happens: Google fetches the sitemap file itself on its own schedule (more frequently for sites it already trusts and crawls often, less frequently for new or low-authority domains), parses out the URL list, and adds any URLs it hasn't seen before to a crawl queue — prioritized alongside everything else Google already knows about the site, not ahead of it. A lastmod date that's genuinely newer than what Google has on file is one of the few signals that can bump a URL up that queue; a lastmod that never changes, or changes on every deploy regardless of real content edits, teaches Google to stop trusting the field entirely. This is also why fixing a sitemap error doesn't show results instantly in Search Console — the Sitemaps report itself usually updates within a day, but the individual URLs still have to work through the normal crawl queue behind it.

How to check yours right now

Paste your sitemap URL into CheckSEO's Sitemap Validator and it runs every check above in one pass — syntax, size, dead links, and robots.txt conflicts — with each issue explained plainly, not buried in an XML parser error message.

Frequently asked questions

How do I know if my sitemap is valid?

Run it through a validator that checks syntax, URL status codes, and size limits together — a sitemap can be syntactically valid XML and still be functionally broken (e.g., full of 404s), so syntax-only checking isn't enough.

Do websites still need a sitemap in 2026?

Yes, especially for new sites, large sites, and sites that publish frequently. Google can find pages without one via links, but a sitemap removes discovery lag — it's the single cheapest thing you can do to speed up indexing.

What's the difference between a sitemap and a sitemap index?

A sitemap lists URLs directly. A sitemap index lists other sitemap files — you need one once your site exceeds 50,000 URLs or 50MB in a single sitemap file.

How often should I update my sitemap?

Automatically, whenever pages are added, removed, or their content meaningfully changes — most CMS platforms and static site generators do this on every build. Manually maintaining one is rarely worth it past a handful of pages.

Does having sitemap errors hurt my rankings directly?

Not directly as a ranking factor — but indirectly, yes: errors that stop pages from being discovered or crawled mean those pages can't rank at all, regardless of how good the content is.

Check your own site with the Sitemap Validator.

Open Sitemap Validator

More from the blog