Skip to the content
searchboar.

Crawling and indexing

What is hreflang?

Hreflang is markup that identifies corresponding language or regional versions of a page, helping search engines select an appropriate version for a searcher.

Also known as: language alternate · hreflang tag

At a glance

  • Connect equivalent pages, not every page in one language to a generic home page in another.
  • Each version should identify itself and provide reciprocal links to its alternatives.
  • Only list translations or regional versions that actually exist and are accessible.
On this page
Pages representing language versions of one piece of content link reciprocally around a globe.
Hreflang connects corresponding language and regional versions of a page.

What relationship does hreflang describe?

A business might have Hungarian and English versions of one service page, or separate English offers for the United Kingdom and Ireland. The pages correspond, even if language, currency or availability differs.

Hreflang connects those particular equivalents. It does not connect every Hungarian article to the English home page. A general home page is usually not a translation of a detailed guide.

How can the annotations be supplied?

Google supports annotations in HTML, HTTP headers or an appropriate sitemap. These approaches are equivalent; maintaining all three is unnecessary.

An illustrative HTML example is:

<link rel="alternate" hreflang="hu" href="https://example.com/hu/service">
<link rel="alternate" hreflang="en" href="https://example.com/service">

Both versions should list themselves and each other using fully qualified URLs that work. hu identifies a language, while en-GB identifies a language and region. A country code on its own is not a substitute for the language code.

An x-default annotation can identify a fallback for users not covered by a particular language or region, such as a suitable language selector. Creating a separate selector is not compulsory for every website.

How is it different from canonical and lang?

A canonical URL indicates a preferred representative of duplicate or very similar content. Hreflang describes corresponding language or regional versions. A complete English translation and its Hungarian equivalent are not created simply so one can disappear in favor of the other.

HTML’s lang attribute identifies language for purposes including assistive technology. Google analyzes page content to determine its language. Hreflang cannot turn Hungarian text into an English page, translate content or redirect a visitor.

Indexing requirements still apply. A broken, blocked or login-only translation does not become searchable because another page names it as an alternative.

An example: bilingual accommodation information

Imagine an apartment house describing the same twin room in Hungarian and English. The amenities agree, and each page contains a meaningful description in its own language. They can identify one another as equivalents.

Later, the business publishes a Hungarian parking guide without an English translation. It should not invent an /en/parking URL or use the room page as a substitute. The relationship can be added when the real translation exists.

A visible language switcher helps the reader navigate. That user-facing function is separate from the markup supplied to a search engine.

Which mistakes should you check?

Common problems include missing return links, invalid language codes, incorrect URLs and removed destinations. An alternative that automatically redirects to another language, or a conflicting canonical annotation, can also undermine the intended relationship.

When a page address changes, update the annotations that refer to it. A URL slug change can affect references stored on many other pages.

A monolingual website does not need invented alternatives. Use hreflang when actual equivalent versions exist, then verify that their content, availability and annotations agree. It supports international SEO, but does not guarantee a ranking in a chosen country or replace an offer that suits the audience.

Sources

  1. Google Search: localized versions of your pages
  2. Google Search: URL canonicalization
  3. Google Search: URL structure best practices