Definition
Hreflang — Hreflang is an attribute that tells search engines about equivalent language or regional versions of the same page.
Quick answer
Every version must list all versions, including itself, with absolute URLs, plus x-default. The annotations must be reciprocal or they are ignored.
Why it matters
Without hreflang, a search engine may show the wrong version (e.g. the English page to a user in Moldova searching in Romanian) or treat the versions as duplicates.
How to implement it
There are three equivalent methods: <link> elements in the <head>, the HTTP Link header (for PDFs), or the XML sitemap. Codes use ISO 639-1 for the language and optionally ISO 3166-1 alpha-2 for the region: ro, ru, en, en-GB.
<link rel="alternate" hreflang="ro" href="https://garbuz.online/servicii/audit-seo/" />
<link rel="alternate" hreflang="ru" href="https://garbuz.online/ru/uslugi/seo-audit/" />
<link rel="alternate" hreflang="en" href="https://garbuz.online/en/services/seo-audit/" />
<link rel="alternate" hreflang="x-default" href="https://garbuz.online/servicii/audit-seo/" />Common mistakes
- missing return links (page A points to B, but B does not point to A);
- hreflang pointing to redirected URLs or URLs canonicalised elsewhere;
- wrong codes (en-UK instead of en-GB);
- hreflang pointing to untranslated pages.
Sources
- Tell Google about localized versions of your page — Google Search Central