Sitemap hreflang declarations lack required structure

In the reportSitemap hreflang markup structurally invalid

sitemap_hreflang_structure_invalid · Issue

Short answer

This appears when the hreflang entries in your sitemap break the structure Google describes: the xhtml namespace is not declared, an entry does not list its own address, or an entry lists a page whose own entry leaves out one of those versions. Make each entry list every version, itself included.

Severity: Medium. Hreflang declarations without the namespace cannot be fully interpreted; fix it when you next regenerate the sitemap.

Why it matters

Google's guide to localized versions asks sitemaps with hreflang to declare the xhtml namespace, and each <url> entry to list every alternate version of the page, including itself.

What to do

  1. Look at the finding: it shows the sitemap files, the entries and what each is missing.
  2. Declare xmlns:xhtml="http://www.w3.org/1999/xhtml" on the <urlset> element.
  3. Make each <url> list all its versions, itself included, and the same set in every version's entry; sitemap generators usually have a setting for this.

What we read

We read every sitemap file the audit fetched, as XML, and nothing else. The site is reported when a file uses xhtml:link without declaring its namespace, when an entry with hreflang does not list its own <loc>, or when entry A lists page B, B has its own entry in the sitemap, and B's list leaves out one of A's versions. Entries missing from the sitemap altogether are not looked for.

When a sitemap cannot be fetched or read in full, or an entry has an address or code we cannot use, the rule cannot confirm a clean result; it may still report a different structural failure supported by complete evidence.

Example & evidence

Illustrative example — one sitemap file, not a live audit.

https://bakery.example/sitemap.xml contains:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://bakery.example/en/</loc>
    <xhtml:link rel="alternate" hreflang="fr" href="https://bakery.example/fr/"/>
  </url>
</urlset>

xhtml:link is used without declaring its namespace, so the site is reported with the file. The missing namespace prevents this check from also deciding whether the English entry lists itself.

Declare the xhtml namespace on <urlset> first. On the next complete check, the English entry can then be assessed; add an en entry for https://bakery.example/en/ itself if it is missing.

Confirm & check again

Check for yourself: open your sitemap file and look for xmlns:xhtml on <urlset>, then check that each <url> lists itself among its xhtml:link entries.

Check again: Full audit — run a new audit of the site. The finding closes only when a complete audit reads every sitemap in full and finds the structure sound. Removing the hreflang entries does not close it as fixed: the check then no longer applies, and the finding is left unconfirmed.

Limits & sources

This rule reads retained sitemap data only; it makes no additional page requests. Versions missing from the sitemap are not looked for, and language codes are left to other checks.

The check compares only explicitly declared pairs between observed entries; it does not infer transitive language groups. An incomplete collection without a proven structural failure stays unknown. A complete collection with no hreflang annotations is not applicable.

Confidence: High because the sitemap XML is read directly.

Sources

Editorial review: 4 November 2026