Skip to main content

Confirm

Are you sure?

SEO · Checked once per domain

Sitemap and page hreflang agreementWhat it checks and how to fix it

What it checks

For every URL whose XML sitemap entry declares hreflang alternates (xhtml:link) and that was crawled in the audit, compares the sitemap's language/URL pairs with the hreflang links in the page's own <head>. It warns when the two sets differ for any URL, passes when they all match, and is skipped when the sitemap has no hreflang annotations.

Why it matters

hreflang can be declared in the sitemap, in the page head or in HTTP headers, and Google combines them. When two sources disagree about which URL serves which language, Google cannot tell which one is right and may ignore the annotations for that page, so searchers get the wrong language version.

How to fix it

Generate hreflang for both places from one source of truth, or declare it in only one place. The sitemap entry and the page head must list the same languages and URLs, including the page itself:

<url>
  <loc>https://example.com/pricing</loc>
  <xhtml:link rel="alternate" hreflang="en" href="https://example.com/pricing"/>
  <xhtml:link rel="alternate" hreflang="es" href="https://example.com/es/precios"/>
  <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/pricing"/>
</url>
<!-- in the <head> of https://example.com/pricing -->
<link rel="alternate" hreflang="en" href="https://example.com/pricing">
<link rel="alternate" hreflang="es" href="https://example.com/es/precios">
<link rel="alternate" hreflang="x-default" href="https://example.com/pricing">

The urlset element needs xmlns:xhtml="http://www.w3.org/1999/xhtml" for the xhtml:link entries to be valid.

Monitor this automatically

Full Stack Audit runs this check and 126 others on your site on a schedule, and emails you when one that passed starts failing.

More SEO checks