Skip to content

Sitemap hreflang checker

Do the language versions in your sitemap list each other, and use codes Google accepts?

  • Checks your page
  • Reads:Sitemap
  • 1 rule
  • Last updated

Reads: Sitemap

Free, no sign-up.

What we keep

We keep the address exactly as you send it, including anything after a “?”, and its report shows it. Anyone who has the report’s link can open it, so leave out tokens, keys and personal data.

The result appears here

Enter your page’s address and press “Check the page”. This is what the tool runs on it:

  • Language versions in the sitemap are not completenot started

What it checks

  • That a page that lists its versions lists itself too.
  • That when page A lists page B, and B is an entry of the same sitemap, B lists A back.
  • That each hreflang is a language, with an optional script and region, that Google accepts: ar, ar-SA, en-GB, x-default; not ara, en-UK or ar_SA.
  • That each version is a full address with https://.
  • A version that is not an entry of the same file may be in another sitemap, and is not judged.

Example

WrongXML
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <url>
    <loc>https://www.example.com/ar/</loc>
    <xhtml:link rel="alternate" hreflang="ar" href="https://www.example.com/ar/"/>
    <xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/en/"/>
  </url>
  <url>
    <loc>https://www.example.com/en/</loc>
    <xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/en/"/>
  </url>
</urlset>
RightXML
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <url>
    <loc>https://www.example.com/ar/</loc>
    <xhtml:link rel="alternate" hreflang="ar" href="https://www.example.com/ar/"/>
    <xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/en/"/>
  </url>
  <url>
    <loc>https://www.example.com/en/</loc>
    <xhtml:link rel="alternate" hreflang="ar" href="https://www.example.com/ar/"/>
    <xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/en/"/>
  </url>
</urlset>

How to fix

Give every page of a group the same list of versions, each with its own address in it:

  • Declare the xhtml namespace on the urlset.
  • Use the codes the hreflang generator writes.
  • Use full addresses that match the pages’ loc.
  • Give hreflang in the sitemap or in the pages’ <head>, not both with different answers.
XML
<url>
  <loc>https://www.example.com/ar/</loc>
  <xhtml:link rel="alternate" hreflang="ar" href="https://www.example.com/ar/"/>
  <xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/en/"/>
</url>

FAQ

Either works. Page tags need no extra file but add to each page's size; a sitemap keeps the pages light and is easier to generate for many versions. Choose one and keep it complete.

It is not required. Google recommends it for people whose language matches no version.

A version that is not an entry of this sitemap may be in another sitemap file, and a single file cannot show whether it lists the page back.

How we measure

Last updated Methodology and scoring

The check reads the xhtml:link elements with rel="alternate" and an hreflang in each entry of each sitemap (urlset) the scan fetched, the first 5,000 entries of each, and compares addresses after normalising them. Codes are judged by the check the hreflang page tools use. The scan fetches only the sitemaps the site's robots.txt names first (or /sitemap.xml), through the egress proxy, and honours the site's robots.txt.