hreflang errors: missing return links, wrong codes and more
hreflang tells search engines which language version of a page to show to which visitor. Errors appear when versions do not link back to each other, a page does not list itself, a language code is invalid, a target redirects or is noindex, or the optional x-default fallback is missing. Every version must carry the same complete set of alternates, and each link must point to a live page that can be indexed.
How the problem happens
The tags are written by hand or by a plugin for one language first and extended later. The new language links back to nothing, a code such as en-UK slips in, or a version is removed and its tag stays.
Why hreflang and language errors matter for visitors and AI search
A multilingual site publishes the same content under several addresses, one per language or region. hreflang is the annotation that links those addresses into a set, so Google can show the German page to a German searcher and the English page to an English one. When the set is broken, search engines fall back to guessing: the wrong language ranks, visitors bounce from a page they cannot read, and the versions can compete with each other.
The rules are strict. Google processes a pair only when both pages point at each other, and it ignores a code it cannot parse. Bing leans more on the lang attribute and the visible text than on hreflang, so a page that declares one language and is written in another sends a contradictory signal. AI search probably depends on the same signals: an assistant answering in German has little reason to favor a page that is not clearly German, so a mislabeled or untranslated version may be less likely to be selected and cited. How assistants choose sources is not published, so treat this as a reasonable expectation, not a measured rule.
How to check hreflang by hand
Open the source of one page in each language and list every rel="alternate" tag. All versions should carry the same complete set, including a tag that points to the page itself, and each address in the set should open directly with status 200. Check the annotations in the three places they can live: the head, the HTTP Link header and the XML sitemap. Use only one of them, because two sources that disagree are harder to debug.
Read each code carefully. The language comes first (en, de), then an optional script and region (sr-Latn, en-GB). Common mistakes are en-UK instead of en-GB, an underscore instead of a hyphen, and a country used alone. Then compare the lang attribute of each page with the language of its text, and the language of its title and description with the language of the body.
In Google Search Console, the page indexing report and the URL inspection tool show which version Google picked as the canonical. If a German page is reported as a duplicate of the English one, the canonical or a redirect is overruling your annotations.
How to fix hreflang in code, server and CMS
Generate the whole set from one list of languages instead of editing tags page by page. For every page the template should output a tag for each existing translation, a tag for the page itself and, optionally, one x-default entry that points to the version you want for visitors whose language you do not serve. The x-default entry is a recommended fallback, not a required part of the set. The block below shows the complete set for a three-language site.
Only list versions that exist. A language without a translated page must not appear in the set, and when a translation is removed, its tag has to go from every other version too. Every target must be a final address that answers 200, is not blocked, is not noindex and points its canonical to itself, because a version that points its canonical to another language tells Google to ignore the annotation.
Set the lang attribute of the html element to the language of the page, with a valid code, and translate the title, description and image alternative texts together with the body. In a CMS, use a single multilingual plugin that stores translations as linked pages, and make sure each language has its own address instead of switching language by cookie on one URL.
<!-- the hreflang set is identical on /, /de/ and /fr/; only the lang value differs -->
<!-- on /: <html lang="en">, on /de/: <html lang="de">, on /fr/: <html lang="fr"> -->
<html lang="en">
<head>
<link rel="alternate" hreflang="en" href="https://example.com/">
<link rel="alternate" hreflang="de" href="https://example.com/de/">
<link rel="alternate" hreflang="fr" href="https://example.com/fr/">
<link rel="alternate" hreflang="x-default" href="https://example.com/">
</head>How RankDossier detects hreflang and language errors
RankDossier reads the lang attribute and the hreflang annotations of each crawled page and follows every alternate it finds. The checks test whether the lang value is missing, invalid or different from the text, whether a version lacks the return link or the self-reference, whether a code is invalid, whether a target is an error, a redirect or noindex, whether hreflang and canonical contradict each other, and whether the optional x-default fallback is present (a minor finding, not an error in the set). One more check looks for a page whose title, description or image alternative texts are in another language than the body.
Each finding names the page and the annotation that failed, so you can correct the template instead of testing every URL. The hreflang checker tests a single page and its return links. The guide to noindex, canonical and multilingual sites shows how the signals work together, the technical SEO audit guide places hreflang among the other technical checks, and the guide to pages that are not indexed helps when a language version is missing from Google.
Wrong and right
Wrong
<!-- only on /en/ -->
<link rel="alternate" hreflang="de" href="https://example.com/de/">
Right
<!-- the same set on every language version -->
<link rel="alternate" hreflang="en" href="https://example.com/en/">
<link rel="alternate" hreflang="de" href="https://example.com/de/">
<link rel="alternate" hreflang="x-default" href="https://example.com/">
How to fix it
WordPress
Use one multilingual plugin that prints reciprocal tags for every translation, and check that each language has its own address instead of a redirect from a single URL.
Next.js
Define alternates.languages in the metadata of every localized page, with the same full set of languages and, optionally, an x-default entry on each version.
export const metadata = {
alternates: {
canonical: '/en',
languages: { en: '/en', de: '/de', 'x-default': '/' },
},
};
Nginx
Nginx does not write hreflang for HTML pages. Make sure each language URL responds without a redirect, and use a Link header for files that are not HTML (for example a PDF); for HTML pages the tags in the head are the usual place.
# the Link header works for any response and is the only option for files that are not HTML (for example a PDF)
add_header Link '<https://example.com/de/guide.pdf>; rel="alternate"; hreflang="de"' always;
Check codes in this family
These checks belong to this family. Each code appears in the audit report with its own explanation and fix.
LANG_MISSINGlang attribute is missingLANG_INVALIDInvalid language codeLANG_MISMATCHlang does not match the text languageHREFLANG_NO_RETURNhreflang without return linkHREFLANG_NO_SELFhreflang without self-referenceHREFLANG_INVALID_CODEInvalid hreflang codeHREFLANG_TARGET_ERRORhreflang points to an error or redirectHREFLANG_TARGET_NOINDEXhreflang points to a noindex pageHREFLANG_CANONICAL_CONFLICThreflang and canonical conflictHREFLANG_NO_XDEFAULTx-default is missingMULTILINGUAL_META_UNTRANSLATEDUntranslated metadata
Related check families
Read the full guide Common indexing and canonical tag mistakes on multilingual sites for the wider picture. Test one page for free with the hreflang checker.
Check your own site
Enter a domain – the free pre-check reads up to 10 pages and shows how many types of problems it finds. You pay only if you want the full report.
Start the free pre-check