Hreflang is an HTML tag that tells engines "this page has versions in other languages, here are the links". Without hreflang, Google and Yandex often serve the "wrong" version to users — Russians get English, Americans get Russian. Conversion from such SERPs drops dramatically. Proper hreflang setup fixes this in an hour. This article walks through the syntax, common mistakes, the x-default vs specific-language difference, and why Yandex treats hreflang differently from Google.
Hreflang syntax
In `<head>` of each page you add tags like `<link rel="alternate" hreflang="ru" href="https://domain.com/ru/page">`. One tag per language version of the page. With 2 languages (RU and EN), each page must have at least 2 hreflang tags — one for RU, one for EN. The EN page carries the same 2 tags linking to both versions. This is the reciprocity rule: if A links to B as alternate, B must link to A.
What is x-default and why it matters
`hreflang="x-default"` is a special value meaning "this version is for any other users whose language isn't listed". With a RU + EN site and a Chinese or Spanish user without hreflang, Google doesn't know which to serve. With x-default Google serves the specified version (usually EN as "universal"). Site Metrics Tool sets x-default on the EN version. Without x-default Google falls back to automatic logic that often gets it wrong.
Where to place hreflang
Three valid locations: one — in the page's `<head>` (most common, easiest to debug); two — in the HTTP `Link:` header (for non-HTML files like PDFs); three — in the XML sitemap (via `xhtml:link rel="alternate"`). Pick one and stick with it — Google dislikes mixed placement (some in HTML, some in sitemap). HTML head is the most convenient for most teams: visible via View Source and easy to debug.
Typical hreflang mistakes
- Reciprocity violation: A links to B but B doesn't link back to A. Google ignores such tags.
- Using `lang="ru-RU"` while `<html lang="ru">` — mismatch confuses parsers.
- Using country codes (e.g., `ru-RU`) when not needed — plain `ru` is better. Country codes are only for different versions for different countries on the same language.
- href pointing to a redirect — Google follows the redirect and substitutes the final URL, but inefficiently. Provide the final URL directly.
- href pointing to a 404 or noindex page. Google ignores such hreflang tags.
- Missing x-default. Not critical but a free optimisation for non-standard users.
How Yandex treats hreflang
Yandex didn't officially support hreflang for a long time. Since 2022 Yandex considers hreflang, but mainly for page-language detection, not user-version selection. For geotargeting Yandex uses its own mechanism via Webmaster ("Regionality"). Practical takeaway: set hreflang for Google (critical) and additionally configure regionality in Yandex Webmaster per country. Without step two Yandex may serve the "wrong" version to a Russian user.
How to verify your setup
First check — Google Search Console → International Targeting → Language. Google shows detected hreflang tags and any errors (reciprocity violations, invalid codes, unreachable URLs). Second — an online Hreflang Tags Testing Tool: enter URL and see all tags and relationships. Third — our free Meta Tags Checker (`/tools/meta-tags-checker`): enter URL, the report has a "hreflang" section breaking down every tag on the page.
Frequently asked
How many hreflang tags should a page have?
One per language version plus x-default. With 2 languages — at least 2 tags, ideally 3 (RU + EN + x-default). With 5 languages — 6 tags.
Do I need hreflang for a single-language site?
No. Hreflang only matters when you have 2+ language versions of the same content.
What if not all of the page is translated?
Hreflang works at the URL level, not content. If the page exists in RU and EN — set hreflang. If only RU — don't point to EN. Don't point hreflang to auto-translated pages — Google detects it and lowers trust.