Bajorat Media

What is a Hreflang Tag?

A hreflang tag helps search engines assign language and regional versions of a website correctly. This article explains use cases and common errors.

A hreflang tag tells search engines which language or regional version of a page is intended for which users. It helps Google and other search engines show the right URL in search results for multilingual or regional websites.

When is hreflang needed?

Hreflang is relevant when several versions of similar content exist for different languages or regions. Typical examples include German and English company websites, shops with country versions or pages with variants for Germany, Austria and Switzerland.

Without hreflang, search engines may display the wrong language version or treat similar pages as duplicate content. For international search engine optimization, hreflang is therefore an important technical signal.

Hreflang is not needed if there is only one language or if a German page merely contains individual English terms. It is about alternative URLs for the same or very similar content in other language or regional versions.

Where is hreflang implemented?

Hreflang can be maintained in three places: in the HTML <head>, in the XML sitemap or in the HTTP header. For classic websites, HTML or sitemap implementation is common. The important point is that all language variants reference each other and that every page also references itself.

A German document can, for example, point to an English variant and to itself. In international setups, x-default can also be useful, for instance for a neutral language selection page.

For larger websites, the sitemap variant is often easier to maintain because language relationships can be managed centrally. For smaller websites, HTML output is easier to inspect. The key is not the location, but the consistency of the signals.

How do hreflang and canonical tags work together?

Hreflang and the canonical tag solve different tasks. Canonical indicates which URL should be treated as the main version of a piece of content. Hreflang indicates which alternative language or regional versions exist.

For multilingual websites, language variants should usually canonicalize to themselves and be connected to each other with hreflang. If every language version is canonicalized to a single URL, Google may not be able to show the alternatives as intended.

Common hreflang errors

In practice, problems often result from incorrect language or country codes, missing return links, inconsistent URLs, redirects in hreflang targets or mixed canonical signals. Automatically generated hreflang sitemaps should also be checked because small errors can affect many URLs.

For WordPress projects, a reliable technical foundation is important. Multilingual content should be planned structurally, not just editorially: URL system, translations, navigation, sitemap, canonicals and redirects have to fit together. This belongs to solid WordPress development when a website is intended to grow internationally.

Google documents hreflang under Localized versions of your pages.

Discuss a project

Do you want to apply this topic to your project?

We help you decide which technical, editorial or strategic steps make sense for your website - and what truly has priority.