Skip to content

hreflang checklist: 21 rules for multilingual websites

If your site runs in German and English, Google has to tell which pages are language versions of each other. That is what hreflang is for. Google determines a page's language from its visible text, not from the lang attribute or the URL. The lang attribute mainly serves accessibility.

Check return links first: when two pages do not point to each other, Google ignores the annotations. Next come fully qualified URLs with protocol, valid language codes and targets without noindex. You can verify all of these in the HTML source, the HTTP headers or the sitemap.

21 rules18 run dailyGoogle evidence checked on

Backed by Google6 · 29%
Google’s documentation recommends what the rule checks.
Partly backed11 · 52%
Google backs part of the rule. The rest goes further or is narrower.
Outside Google Search4 · 19%
It concerns accessibility, security, law or users, not Google Search.

Language versions and hreflang 21

Backed by GoogleRuns daily

hreflang targets are fully qualified URLs with protocol

Check
Every href in an hreflang annotation must be a full URL with protocol (HTTP or HTTPS) and host. Empty, relative, protocol-relative or malformed values fail the rule.
Fix
Write each target as a full URL with protocol and host, never as a bare path or a protocol-relative value.
Google
Google requires fully qualified alternate URLs, including the protocol. Protocol-relative values starting with // and bare paths do not qualify.

localization.hreflang-absolute-urlRevision 1changed

Backed by GoogleRuns daily

Every hreflang target links back to the source page

Check
Tests whether each listed language version names the source page in return via hreflang. Fails when an inspected target lacks that return link.
Fix
Add the return link on every target page, with the same codes and URLs as on the source page.
Google
Google ignores hreflang annotations when two pages do not point to each other, so no other site can declare itself a version of your page. If some languages are omitted, Google still processes the mutual pairs.

localization.hreflang-reciprocityRevision 1changed

Backed by GoogleRuns daily

Each language version lists itself in its hreflang annotations

Check
A page in an hreflang set must list itself with its matching code. Fails when this self-reference is missing.
Fix
Include the current page with its own code in the hreflang list, following the same pattern on every language version.
Google
Google explicitly requires the hreflang list of every language version to include that version itself, alongside all the others.

localization.hreflang-self-referenceRevision 1changed

Backed by GoogleRuns daily

Language versions are not accidentally excluded from indexing

Check
Unlike the target checks, this one looks at the source page itself. Fails when a page meant to appear in search still carries noindex.
Fix
Remove the accidental noindex, or take the page out of the hreflang set.
Google
When Googlebot finds noindex in a meta tag or HTTP header, Google removes the page from search results entirely, even if other sites link to it.
Note
The site owner decides whether noindex is a mistake; only then can the rule pass or fail.

localization.hreflang-source-noindex-policyRevision 1changed

Backed by GoogleRuns daily

hreflang targets are not excluded from indexing

Check
Inspects the target pages of all hreflang annotations for an effective noindex, whether in a meta tag or an X-Robots-Tag header. Fails when any target carries noindex.
Fix
Remove an unwanted noindex from the target page, or delete the hreflang link to it.
Google
When Google crawls a page and finds noindex in a meta tag or HTTP header, it drops the page from search results entirely. A language version excluded this way cannot be shown to searchers.

localization.hreflang-target-noindex-absenceRevision 1changed

Backed by GoogleRuns daily

Incoming hreflang codes are valid

Check
Checks the codes other pages use when they point to this URL via hreflang. Fails when a code is malformed or unsupported by the selected search engine; matching the right pattern is not enough.
Fix
Correct the code on the referring page, using ISO 639-1 for the language and ISO 3166-1 Alpha 2 for the region.
Google
Google supports only ISO 639-1 language codes and ISO 3166-1 Alpha 2 region codes, so es-419 does not work. ISO 15924 script codes are allowed, and x-default is reserved for the fallback page.

localization.incoming-code-validityRevision 1changed

Partly backedRuns daily

Each hreflang code points to exactly one URL

Check
Within an hreflang set, each code may have only one target. Fails when the same code names two different URLs; different codes sharing one URL are allowed.
Fix
Keep exactly one target URL per code and delete the other entries.
Google
Google describes how language and region codes map to individual versions and requires each version to list itself and all others. Its documentation states no explicit rule against duplicate codes.

localization.hreflang-code-single-targetRevision 1changed

Partly backedRuns daily

HTML, HTTP header and sitemap deliver the same hreflang mappings

Check
When hreflang is delivered in more than one way, the rule compares the mappings from <link> elements, the Link header and the sitemap. Fails when they contradict each other; mere coexistence is fine.
Fix
Align the generators, or settle on the one method you can maintain reliably.
Google
Google treats the three methods as equivalent and allows using them together, but says combining them brings no benefit in Search. It notes that three implementations are harder to manage than one.

localization.hreflang-method-agreementRevision 1changed

Partly backedRuns daily

The hreflang self-reference and the canonical tag name the same URL

Check
Compares the URL in the hreflang self-reference with the canonical URL of the same page. Fails when the self-reference names a URL whose canonical points elsewhere.
Fix
Set one canonical URL per language version and use exactly that URL in the hreflang self-reference.
Google
With hreflang, Google recommends a canonical in the same language, or the best substitute language if none exists, and advises against conflicting canonical signals. It does not require exact equality with the self-reference.
Note
This rule is stricter than Google; deliberately consolidating regional versions does not violate Google's guidance.

localization.hreflang-self-canonical-agreementRevision 2changed

Partly backedRuns daily

hreflang targets respond without a redirect

Check
Each fetched hreflang target is checked for an HTTP redirect. Fails when a target redirects; targets that were not fetched remain unknown.
Fix
Put the final URL of the language version straight into hreflang instead of a redirecting address.
Google
Google requires fully qualified URLs with protocol. Its current documentation does not say redirecting targets are ignored or invalid; using final URLs is a matter of hygiene here.

localization.hreflang-target-no-http-redirectRevision 1changed

Partly backedRuns daily

hreflang targets are crawlable under robots.txt

Check
For each active hreflang link, tests whether robots.txt allows the target for the crawler in question. Fails when a target is disallowed; unchecked targets do not count as allowed.
Fix
Allow the target in robots.txt, or drop the hreflang link if the page should stay blocked.
Google
Google uses hreflang to recognize language versions and explains how robots.txt matching works: the most specific rule wins, and in conflicts the least restrictive one. An allowed target is not thereby processed or indexed.

localization.hreflang-target-robots-accessRevision 2changed

Partly backedRuns daily

Every hreflang target resolves to a usable HTTP URL

Check
Resolves each href and checks syntax only, not reachability. Empty, malformed or non-HTTP(S) values, and bare fragments such as #en, fail the rule.
Fix
Fix the malformed target so it points to a real HTTP or HTTPS address.
Google
Google requires full URLs with protocol. This rule is weaker: a relative href can pass it and still fail the separate rule on fully qualified URLs.

localization.hreflang-usable-url-syntaxRevision 1changed

Partly backedRuns daily

Incoming hreflang annotations assign compatible languages to a URL

Check
Collects every hreflang code that other pages in the set use for one URL. Fails when those codes claim conflicting languages or break the approved mapping of languages to URLs.
Fix
Correct the language assignment on the referring pages.
Google
Google describes hreflang as a way to label language versions and allows the generic page for a language to be one of the regional pages. Several compatible codes for one URL are therefore not a conflict.

localization.incoming-code-consistencyRevision 1changed

Partly backedRuns daily

The lang attribute and the page's own hreflang code name the same language

Check
Compares the primary language in lang on the <html> element with the hreflang code the page uses for itself. Fails when the two disagree; if either is missing, no comparison is possible.
Fix
Correct whichever declaration does not match the page's actual language.
Google
Google uses hreflang to link language versions, but detects language from visible content, not from lang or hreflang. Matching declarations are good hygiene, not proof that the language is right.

localization.lang-hreflang-primary-agreementRevision 1changed

Partly backedRuns daily

When x-default shares a URL with a language version, that is intended

Check
Applies to hreflang sets where x-default points to the same URL as a language code. Fails when that choice contradicts the agreed fallback page.
Fix
Decide which page users without a matching language should see, and set exactly that page as x-default.
Google
Google describes x-default as the fallback for users whose language settings match no version; it was designed for language selector pages but works for any page. Google requires no separate URL for it.
Note
The rule needs the site owner's decision on the fallback page; without it, the rule can neither pass nor fail.

localization.x-default-overlap-intendedRevision 1changed

Outside Google SearchRuns daily

The lang attribute holds a valid language tag

Check
Tests whether lang on the <html> element holds a non-empty, valid BCP 47 tag such as en or de-DE. Fails when the value is missing, empty or invalid.
Fix
Declare the actual primary language as a valid BCP 47 tag, for example en for English.
Google
Not a Google Search topic, since Google detects language from visible content. A valid lang serves accessibility and document semantics by telling assistive technology which language to use.

localization.document-language-validRevision 2changed

Outside Google SearchRuns daily

lang and xml:lang name the same language

Check
Applies when the root element carries both lang and xml:lang. Fails when they name different languages; if one attribute is missing, there is no conflict.
Fix
Align both declarations, or drop the obsolete xml:lang from HTML documents where appropriate.
Google
Not a Google Search topic, since Google does not use lang to detect language. The rule concerns the document's conformance with web standards, which also bears on accessibility.

localization.lang-xml-lang-agreeRevision 1changed

Outside Google SearchRuns daily

Language tags on individual passages are valid

Check
Inspects lang attributes on elements below <html>. Fails when a non-empty value is malformed or invalid; a deliberately empty lang for an unknown language is fine when documented.
Fix
Repair malformed tags, and keep deliberately empty values for unknown languages.
Google
Not a Google Search topic, since Google does not use lang to detect language. It concerns accessibility: a lang on a wrapper element overrides the page language for that passage.

localization.passage-language-tag-validRevision 1changed

Partly backed

Language versions form a consistent hreflang set with return links

Check
Examines all genuine language versions of a page as one set. Fails when a member lacks a needed return link, or an annotation points to a wrong, redirected or non-equivalent URL.
Fix
Generate the hreflang annotations for all language versions from one shared source, using final URLs.
Google
Google requires every language version to name itself and every other version, and ignores annotations that are not mutual. If a full set is hard to maintain, Google still processes subsets that point to each other.
Note
Monolingual sites need no hreflang, and annotations must not announce translations that do not exist.

localization.hreflang-clusterRevision 1

Partly backed

Title and H1 are in the page's language

Check
Applies to pages aimed at one language audience. Fails when the <title> or main heading (H1) is unintentionally in a different language than the page; names and technical terms are exempt.
Fix
Translate the <title> and H1 for the page's audience, using the same terms as the rest of the page.
Google
Google recommends writing the title in the same language and script as the main content. It sets no such rule for the H1, and it detects a page's language from the visible content.

metadata.language-matches-pageRevision 1

Outside Google Search

The HTML lang attribute names the page's actual language

Check
Checks lang on the <html> element of public pages. Fails when the attribute is missing, invalid or names a language other than that of the main content.
Fix
Set lang from the page's actual language, and mark sections in another language with their own lang.
Google
Not a Google Search topic: Google detects language from visible content and does not use lang for that. The attribute serves accessibility by telling assistive technology which language to use.

localization.document-languageRevision 2

Have these rules put into practice on your site.

We’re starting with a few companies and opening up step by step. The first customers get founding terms. Cancel monthly, no minimum term.

What happens next

  1. 1

    Before launch

    We get in touch personally and check whether XEO fits your company. If the answer is no, we’ll tell you plainly.

  2. 2

    At launch

    You give us access to your website, Search Console and Analytics, using a short checklist.

  3. 3

    After that

    Reviewed changes go live continuously. Every Monday you see what moved.

We only use your details to contact you when XEO opens. No newsletter. A short email to contact@usexeo.com is enough to have your signup deleted. Privacy