Skip to content

SitemapGroup — validity & format

Wygard validates every sitemap against the sitemaps.org protocol and alerts you when the XML declaration or structure is malformed.

Scope Tier Default Alert
Site-wide Basic On — every sitemap declared in robots.txt 🔴 Danger

Why it matters

A sitemap only works if search engines can parse it. A missing XML declaration, a broken tag, or a structure that doesn't match the protocol can make a crawler reject the entire file — not just the offending line — so every URL inside goes unsubmitted. Because the file still returns 200 and looks fine in a browser, a validity break hides until you notice pages aren't getting discovered.

The default severity is Danger: a sitemap the crawler can't parse silently removes your whole URL list from the discovery path.

What Wygard checks

On every run, for each sitemap and sitemap index, the crawler:

  1. Confirms the first line declares the XML version and encoding<?xml version="1.0" encoding="UTF-8"?> (or 1.1).
  2. Validates the full file against the sitemaps.org protocol — correct root element, well-formed <url>/<loc> structure, valid tags throughout.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url><loc>https://example.com/</loc></url>
</urlset>

Common alerts

  • Missing or malformed XML declaration — the first line doesn't declare a valid version and encoding.
  • Sitemap fails protocol validation — the file doesn't conform to the sitemaps.org schema (a broken tag, a wrong root element, invalid structure).

Why the default is Danger

A parser that hits invalid XML usually discards the whole sitemap, not just the bad line. That drops every URL in the file from Google's discovery queue at once — with no on-page symptom — so this test surfaces the break immediately.

Responding to an alert

  1. Open the alert and check which sitemap failed and why.
  2. Decide whether the change was intended (rare) or accidental (a generator bug, an encoding issue, a hand-edit that broke the XML).
  3. Fix the source — restore a valid declaration, correct the malformed tags, regenerate the file.
  4. The next crawl re-validates the file and turns the test green.

Pair it with Size & Limit

Validity confirms the sitemap is well-formed; the Size & Limit test confirms it's within the protocol's bounds. A file can be perfectly valid and still be ignored for being too large — so watch both.