3 min read
What hreflang links to what on a multilingual site
The most common mistake on a multilingual site is adding the translation and assuming the two pages will find each other.
Furkan ÇolakDeveloper

The Turkish page is live, the English one is live, and both show up in search. Here is where it goes wrong: someone searching from Germany gets the Turkish page and someone searching from Turkey gets the English one. Both are correct pages. They know nothing about each other, and the thing that tells them is hreflang.
The links have to be reciprocal
This rule is harsher than the other two. Breaking it raises no warning at all, and Google’s documentation is a single sentence about it: if two pages do not point at each other, the annotations are ignored.
So adding the English version to the Turkish page is not enough; the English page has to point back at the Turkish one. A one-way set produces the same outcome as no set at all.
In practice that means this: adding a translation requires touching two files. Three files on a trilingual site.
Every page lists itself too
The second rule looks redundant at first: the Turkish page has to show the Turkish page in its own hreflang list.
The reason is mechanical. When Google sees a page it reads which language that page belongs to straight from this list, and without a self-referencing line it treats the set as incomplete. On a trilingual site every page carries three lines. One of them is itself.
Who x-default is for
The third kind of line is x-default, and its job is to answer one question: when no version matches the user’s browser language, which page gets shown?
On a site offering Turkish, English and German, a visitor from Japan has no version matching their language, and x-default fills exactly that gap. Usually it points at the English page.
Because it is not a required field it gets skipped often; when it is skipped, the decision falls to the search engine.
Language codes follow ISO
A code consists of an ISO 639-1 language code plus an optional ISO 3166-1 Alpha 2 country code; a dash sits between the two. tr, en and de-AT are all valid.
Two mistakes are common. The first is invented codes, the second is writing a country code without a language. uk, for instance, gets taken for the language code of Ukrainian; it is actually the country code of the United Kingdom, and on its own it is invalid.
Three methods, pick one
Annotations can come from three places. link elements in the page head, the Link field in the HTTP response header, alternate entries in the sitemap.
The three are equivalent. Google recommends picking one, because a list maintained in three places drifts apart over time and it stops being clear which one is right.
The sitemap method makes life easier on large sites, since it is managed from one place without touching the files at all. On small sites the page head stays more visible.
The check
Open a page, count the hreflang lines in the source. There should be as many lines as languages.
Then open one of the translations from that list and repeat the count there. If the second page does not show the first, the set is incomplete, and an incomplete set does nothing at all. The full rules are in Google Search Central, “Localized versions”.
Recommended articles

Choosing a typeface and loading it on the page
Loading six cuts instead of three adds a few hundred kilobytes, and nobody can see the difference.

How to move a domain without taking email down
Address records and mail records live in the same zone and do entirely different jobs. A migration touches only one of them.

Which events are actually worth measuring on a site
Before an event goes on the list, one question gets asked: which decision will this number change?