SEOscanner.app

Free check · hreflang

Hreflang tag checker

Read the hreflang annotations on a page and the pages it links to, then check language and region codes, absolute URLs, self-references and placement, and load each alternate version to see whether it links back.

Loads the URL you enter and the home page, then pages they link to, up to 12 pages, and up to 12 alternate and canonical URLs they name. It reads link elements and Link headers; hreflang in sitemaps is read by the full audit. Free, no account needed.

What the checker reads

Enter a page and the checker loads it, the home page and the pages they link to, twelve in all. On each it collects hreflang annotations from link rel="alternate" elements and from Link response headers. It then requests up to twelve of the alternate URLs those annotations name, on any host, to see what each returns and whether its own annotations point back. Annotations in XML sitemaps, the third method Google supports, are read by the full audit, which reads your sitemaps and crawls far more pages.

The results show:

  • every annotation on each page: the hreflang value, the URL, where it was declared and whether it sits in the head;
  • whether each page lists itself among its alternates;
  • what each alternate returned and whether it names the page back;
  • language and region codes Google does not support, and URLs without http or https;
  • canonical tags that point to a page in another language.

How hreflang works

hreflang marks a set of URLs as language or regional versions of the same page. Google sets two conditions for that set to count. Every version lists the whole set, itself included:

“Each language version must list itself as well as all other language versions.”

[G-HREFLANG] Guidelines for all methods

And every pair has to agree: “If two pages don't both point to each other, the tags will be ignored.”[G-HREFLANG] A French page that names its English version, while the English page never names the French one, carries an annotation Google drops. The checker judges reciprocity pair by pair, so one broken pair does not hide the rest.

hreflang is not how Google works out what language a page is in: “Google doesn't use hreflang or the HTML lang attribute to detect the language of a page; instead, we use algorithms to determine the language.”[G-HREFLANG] The checker never counts a page without hreflang as an issue.

Common hreflang mistakes

Return links that are missing

Language versions published at different times, or templates updated in one language and not another, leave pairs that point one way only. The reliable fix is structural: generate every member's annotations from one record of the translation group, so all of them carry the identical, complete set.

Codes Google does not support

Values follow a fixed grammar:

“Only language codes listed in ISO 639-1 and region codes listed in ISO 3166-1 Alpha 2 are supported; other codes that aren't listed in those standards, such as es-419, aren't supported.”

[G-HREFLANG] Supported language and region codes

A region needs a language in front of it: “You can't specify the country code by itself.”[G-HREFLANG] Several popular codes fail on this ground. en-UK should be en-GB, and Latin American Spanish written as es-419 needs a language alone (es) or a country such as es-MX. Using EU, UN or UK as a region “doesn't have an effect on Google Search”[G-HREFLANG]. Beyond those lists, Google also accepts x-default.

Relative URLs

“Alternate URLs must be fully-qualified, including the transport method (http/https)”[G-HREFLANG]. A path such as /fr/, or a protocol-relative //example.com/fr/, fails that test. Build alternate URLs from the site's configured base address.

Annotations outside the head

“The <link> tags must be inside a well-formed <head> section of the HTML.”[G-HREFLANG] A stray img, iframe, divor piece of text in the head makes the HTML parser close it early, and every link after that point lands in the body. Google's advice for canonical tags applies here too: “make sure at least the <head> section is valid HTML”[G-CANON]. The checker names the element that closed the head and the line it sits on.

hreflang combined with media

Google's guidance on link elements says “don't combine hreflang annotations with other attributes such as media in a single <link> tag.”[G-HREFLANG] Write one link element per annotation.

A canonical in another language

A localized page whose canonical names a page in another language tells search engines that the other language is the version to show. Google's canonicalization guidance is to “specify a canonical page in the same language, or the best possible substitute language”[G-CANON]. Make each localized page canonical to itself, and check the rest with the canonical tag checker.

More than one method

Link elements, HTTP headers and sitemaps are equivalent ways to declare the same set, and using all three brings “no benefit in Search”[G-HREFLANG]. Choosing one method per set of URLs leaves a single place to update. The checker notes pages that mix methods without counting it as an issue.

What this checker cannot tell you

Whether the translations are good, or whether each version serves the audience you intend. It also cannot judge pages beyond its small crawl, and an alternate it did not request is shown as such rather than guessed at. For a site with many language versions, the full audit crawls far more pages and reads the annotations in your sitemaps as well.

The rules this checker runs

Each is a rule from the full ruleset, run by the same evaluator, with the same reason templates and citations. A rule's page lists its fail conditions and the passages it rests on. Informational rules (C4) never produce an issue.

  • SEO-I18N-07hreflang links are inside the headC1 Mechanism· w8
  • SEO-I18N-02hreflang includes the page itself and is reciprocatedC1 Mechanism· w8
  • SEO-I18N-03hreflang URLs are fully qualifiedC1 Mechanism· w8
  • SEO-I18N-04hreflang values are supported codesC1 Mechanism· w8
  • SEO-I18N-06Localized pages canonicalize within their languageC2 Recommended· w4
  • SEO-I18N-08hreflang is not combined with mediaC2 Recommended· w4
  • SEO-HEAD-05The head is not closed earlyC2 Recommended· w4
  • SEO-I18N-09hreflang targets that do not loadC4 Informational· w0
  • SEO-I18N-05One annotation method per URL setC4 Informational· w0

Primary sources

The documentation this page and its rules rest on, with the date each page showed and the date its wording was last checked. The source registry lists every source the scanner may cite.

This page checks one thing. The full audit runs all 70 scored rules.

It covers 16 categories on up to 200 pages, orders the fixes by the strength of the evidence behind them and prints its score with the arithmetic. Every finding cites the primary source it rests on. No account is needed.

Run the full 70-rule audit