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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.