SEO
Multilingual websites: using hreflang correctly
Your French customer searches for you and lands on the German page. Or worse: Google thinks your four language versions are copies. A few lines of hreflang settle who should take which door.
In short
- hreflang tells Google which pages are language or regional versions of one another.
- The annotations must be reciprocal: each version points to all the others and to itself.
- Real translations at their own addresses beat automatic language detection and redirects.
What it is about
Many B2B companies sell across borders and therefore offer their website in several languages. To Google, these versions are at first simply different pages with similar content. For the French buyer to see the French page and not the German one, Google needs a hint. That hint is called hreflang.
How it works
According to Google Search Central, there are three equivalent ways to declare language versions: link elements in the page head, HTTP headers or entries in the sitemap. Each entry names a language code and the address of the matching version.
Language codes follow ISO 639-1, so de, en, fr, es. Optionally, a region according to ISO 3166-1 can be added, such as de-AT for Austria. The special value x-default marks the page for everyone whose language is not offered.
Reciprocity is decisive. Google states: if page A points to page B, page B must point back to page A. Otherwise the annotations may be ignored. Each version also names itself.
Where it goes wrong
The most common mistake is missing return links. The German page lists the English one, but the English page does not list the German one. Almost as common: hreflang points to addresses that redirect, are set to noindex or carry a different canonical.
A second problem is automatic redirection by browser language or location. Google advises against it because users, and the crawler, may then never reach certain versions. A clearly visible language switcher is better.
Third: half translations. An English page whose menu is English but whose text stays German helps nobody. And a language switcher that jumps to the home page instead of the matching subpage frustrates visitors.
How to proceed
Give each language version its own permanent address. Set hreflang on every page for all versions, including the page itself, and add x-default. Only publish a page once it is ready in all offered languages, so the switcher never leads nowhere. Check the annotations automatically after every expansion.
Read more: How Google finds, understands and ranks your website, Structured data: how to tell search engines who you are and Canonical and duplicate content: one page, one address.
How Airnite helps
Airnite builds multilingual websites where hreflang, canonicals, sitemap and language switcher are generated from a single source. This website appears that way in German, English, French, Spanish, Russian, Arabic and Italian.
Checklist
Sources
Every fact in this article is based on the following publications. Primary sources are marked.
- Google Search CentralTell Google about localized versions of your page
- Google Search CentralManaging multi-regional and multilingual sites
- Library of Congress (ISO 639-2 Registration Authority)ISO 639 Language Codes
Matching services
Read on
How Google finds, understands and ranks your website
Before a page can rank, Google has to find it, read it and consider it worth keeping. At each of these three doors pages fail every day, often because of a single line of code.SEO3 minStructured data: how to tell search engines who you are
People read your website; machines guess. Structured data takes the guessing away: this is the company, this is the address, this is an expert article from 22 November. It sounds trivial, and it prevents misunderstandings.SEO3 minCanonical and duplicate content: one page, one address
With and without www, with and without a trailing slash, with filter parameters and as a print version: your service page may exist eight times. Google has to pick one, and does not always pick the right one.Current incidents and warnings are covered in the Zero Day magazine. Go to the magazine