Skip to main content

Short answer

hreflang is an annotation that tells search engines which language or regional versions exist for the same content, so a German buyer finds the German page and a US buyer the English one. It shows the right version to the right person; it does not raise rankings directly.

In detail

hreflang can be declared in three places: link tags in the page head, HTTP response headers, or sitemap.xml. Pick one and keep it consistent. A value is a language code (ISO 639-1, such as en, de, zh) plus an optional region code (ISO 3166-1, such as en-GB, zh-CN), and x-default marks the fallback page when no version matches. Three rules are strict. Annotations must be reciprocal: if page A declares page B, page B must declare page A, or the pair is ignored. Each page must include an entry pointing to itself. And every URL must be a canonical address that loads normally and can be indexed, not a redirect or a noindex page. hreflang is used mainly by Google and Yandex. It does not merge content; it only swaps between versions, so each language version still has to be good enough on its own.

In practice

On this site Chinese pages have no path prefix and English pages sit under /en. Each page declares three hreflang entries (zh-CN, en and x-default) in both the head and the sitemap, and the two languages point to each other.

Common pitfalls

  • Adding an annotation on the English page that points to the German page, with no return link from the German page, which invalidates the set.
  • Getting the region code wrong, such as en-UK (the correct code is en-GB), or giving a region with no language.
  • Redirecting visitors automatically by IP address. Crawlers mostly visit from the United States and would never see the other language versions.
  • Machine-translating dozens of language versions and adding hreflang. Low-quality translated pages do not rank because they are annotated.

Related articles

See how your website measures up

The free AI visibility audit checks your technical foundation and tests whether AI recommends you

Start the audit