Warningindexing.hreflang-pairs

Language versions that don't link back to each other

Why it matters

hreflang tells search engines that two pages are the same content for different languages or countries, so a visitor in Germany is shown the German page. It only works in pairs. Google: "If two pages don't both point to each other, the tags will be ignored", and "Each language version must list itself as well as all other language versions." One missing link back, or a code that doesn't exist, and the annotation is silently dropped: the wrong language turns up in the wrong country's results. Google's page notes that region codes such as UK, EU and UN have no effect; the code for the United Kingdom is GB.

Source: Tell Google about localized versions of your page. A code is a "language code (in ISO 639-1 format) followed by an optional second code that represents the region code (in ISO 3166-1 Alpha 2 format)", or x-default; "Specifying the region alone is not valid."

How to fix it

Every language version must list every version, itself included, and the lists must agree:

<link rel="alternate" hreflang="en-gb" href="https://www.example.com/cakes" />
<link rel="alternate" hreflang="de" href="https://www.example.com/de/kuchen" />
<link rel="alternate" hreflang="x-default" href="https://www.example.com/cakes" />

Put the same three lines on both pages. Translation plugins (WPML, Polylang, Weglot) write these for you when each page is linked to its translation in the editor.

Examples

These are the rule's own test pages, and what it says about each. They are run on every change to the rule book.

Warninghttps://www.example.com/cakes: hreflang "en-UK" isn't valid: the region should be GB, so search engines ignore it.

fail-en-uk
Example site
{
    "pages": [
        {
            "url": "/cakes",
            "hreflang": [
                {
                    "lang": "en-UK",
                    "href": "/cakes"
                }
            ]
        }
    ]
}

Warninghttps://www.example.com/cakes names https://www.example.com/de/kuchen as its de version, but that page doesn't link back, so search engines ignore the pair.

fail-no-return-link
Example site
{
    "pages": [
        {
            "url": "/cakes",
            "hreflang": [
                {
                    "lang": "de",
                    "href": "/de/kuchen"
                }
            ]
        },
        {
            "url": "/de/kuchen"
        }
    ]
}

PassedEvery language version we scanned links back to its counterparts.

pass-reciprocal
Example site
{
    "pages": [
        {
            "url": "/cakes",
            "hreflang": [
                {
                    "lang": "en-gb",
                    "href": "/cakes"
                },
                {
                    "lang": "de",
                    "href": "/de/kuchen"
                },
                {
                    "lang": "x-default",
                    "href": "/cakes"
                }
            ]
        },
        {
            "url": "/de/kuchen",
            "hreflang": [
                {
                    "lang": "en-gb",
                    "href": "/cakes"
                },
                {
                    "lang": "de",
                    "href": "/de/kuchen"
                }
            ]
        }
    ]
}