DELTAWEB
All posts
Technical SEO

What Is hreflang? A Complete Guide from Basics to Advanced

hreflang explained: language-region codes, reciprocal return links and x-default rules. Learn the common errors to avoid and run a clean multilingual site.

What Is hreflang? A Complete Guide from Basics to Advanced
10 minReading time
Arif KuruAuthor

Imagine a procurement manager in Germany landing on your export site and seeing a Turkish page. Or worse, imagine a search for your product in German returning your English page to a buyer who would have preferred the German version. How does a search engine know which page is meant for which language and region, and which versions of the same content exist? The answer is a small HTML signal called hreflang.

Key Takeaways

  • hreflang tells search engines which language and region each version of a page targets.
  • The language code (ISO 639-1) is required; the region code (ISO 3166-1 Alpha-2) is optional.
  • Every page must list the full set of versions, including itself; return links are mandatory.
  • x-default names the fallback page for users whose language matches no version.
  • hreflang is a hint, not a directive; correct implementation and consistency decide the outcome.

What hreflang is and what problem it solves

hreflang is an annotation attribute that tells search engines which language, and optionally which regional audience, a page is meant for, and where the other language versions of the same content live. In short, it is a map that says: this page is for Turkish readers, that one for English readers, and that one for German readers.

The problem is that the versions of a multilingual page are nearly identical in topic. A search engine may treat them as duplicates, or show the wrong language version to a user. hreflang reduces that ambiguity. Google's official documentation describes hreflang as a hint: the search engine takes the annotation into account, but it does not guarantee that every annotation will be applied exactly as written.

What does the signal actually change?

When implemented correctly, a user in Germany may see the German or English version, while a user in Türkiye sees the Turkish one. When implemented poorly, internal pages get mixed up in results, users land on the wrong language, bounce back, and the versions end up weakening each other.

Is hreflang the same as translation?

No. Translation changes the language of the text. hreflang tells the search engine how the versions relate to each other. A translated page without links to its counterparts causes confusion, and so does a set of links that point to pages nobody has translated. Both halves have to be right.

Basic syntax: language and region codes

An hreflang value has two parts: a required language code and an optional region code. The language code follows ISO 639-1 and the region code follows ISO 3166-1 Alpha-2. For example, tr targets Turkish speakers in general, while tr-TR targets Turkish speakers in Türkiye. For the full code lists and practical examples, see the language and region codes guide.

Language first, then region

Language codes are two lowercase letters: de, fr, es, ar. A region code is a two-letter country code appended with a hyphen. So de-AT targets Austrian German and de-CH targets Swiss German. If there is no meaningful regional difference in the content, using only de is enough.

The most common code mistake

Writing en-UK for the United Kingdom is a frequent error. In ISO 3166 the code for the United Kingdom is GB, while uk stands for Ukrainian on the language side. The correct value is en-GB.

ValueMeaningStatus
trTurkish, no region specifiedValid
tr-TRTurkish, TürkiyeValid
en-GBEnglish, United KingdomValid
en-UKNot a valid region codeInvalid, use en-GB
x-defaultFallback page for users whose language matches no versionValid

Letter case makes no practical difference, but pick one format and use it across the whole site. As teams grow, different people write codes differently; generating the code list from a single source prevents most of these errors.

Which pages belong in an hreflang set?

Not every page needs an hreflang set. The decision depends on whether the page has a real counterpart in another language. The table below gives a general frame for common page types.

Page typeBelongs in a set?Note
Translated product pageYesAll language versions should reference each other
Untranslated product pageNoLeave it out so you do not send a wrong-language signal
Language selector homepageWorth consideringA good candidate for x-default
Noindex pageNoA page excluded from search should not sit in the set
Filtered or parameter URLUsually noShould stay consistent with its canonical URL

Scope is not only a matter of how many translations exist. It also matters whether the content serves the same purpose. If two pages describe the same product and answer the same buyer intent, the set logic works. Pages focused on different product lines in different markets should not be forced into one set.

The most overlooked hreflang rule is this: if one page points to another language version, that version must point back. This is called a return link. A one-way annotation does not create a reliable relationship for the search engine.

Every page must include itself

Each page must list the full set, including its own address. The English page's set contains en as well as tr, de or other versions, and the same set should be reflected on every version.

A hypothetical example

A company in Bursa that makes zippers (hypothetical example) publishes Turkish, English and German versions. The German page lists the Turkish and English versions, but the English page does not list the German one. Because the relationship is one-way, the search engine may not trust the set, and a buyer in Germany could see the wrong version. The fix is to add the missing entry to the English page, and to verify the set by reading the complete group from every version.

To catch these problems regularly, start from a list of pages and run a crawl that checks every return link. For the types of errors and how to fix them, see the hreflang errors section of the international SEO guide.

x-default: the fallback page

x-default marks the default page shown when the user's language does not match any version. For example, if a visitor in Japan matches none of your Turkish, English or German versions, the x-default page is the one that applies. In practice this is usually a language selector page or your broadest English version.

When does x-default make sense?

If your homepage has a language selector, marking that page as x-default is a common and sensible choice. If every version is country-specific and there is no clear default audience, you can skip x-default, but make that decision deliberately. You can see practical implementation patterns in the x-default guide.

x-default is not a language

x-default is neither a language nor a region code. Think of it as a multilingual fallback page. If you have a real English version, assigning x-default to it is a frequent and practical choice. What matters most is applying the decision consistently across the whole set.

Checklist for the core rules

Before you publish any hreflang setup, run through this list:

  1. Does each language version list the full set on its own page?
  2. Does every language and region code follow the ISO standards?
  3. Are all addresses in the set written as full, absolute URLs?
  4. Is the return link complete between all versions?
  5. Does each page include itself?
  6. Was the x-default decision made on purpose?
  7. Are the listed pages indexable and canonical?

The last item matters. Putting a noindex page, or a page that canonicalizes to another URL, into the set mixes up the signals. Google's documentation recommends that hreflang annotations point to canonical pages.

Common mistakes and how to avoid them

Wrong language match

Marking a page whose content is in English as tr sends users the wrong language. Make sure the annotation reflects the page's real language. If the language is hard-coded in a template, it can stay wrong after translation.

Relative URLs

hreflang addresses should be written as full URLs such as https://yourdomain.com/en/product, not relative paths like /en/product. Relative addresses can be interpreted differently depending on the domain the page is served from.

Broken or redirected addresses in the set

If an address in the set returns a 404 or sits inside a redirect chain, the search engine cannot establish the relationship. Check regularly after publishing, especially after URL changes.

Listing noindex pages

A page excluded from search that still appears in the set prevents that language version from being shown to users. List only indexable pages.

Conflicts with canonical tags

If a page's canonical tag points to another version, hreflang should follow the same logic. Otherwise the search engine cannot tell which version should be treated as primary.

Implementation methods: HTML, HTTP headers and sitemaps

hreflang can be implemented in three ways. The right choice depends on your technical setup and content type.

The most common method is adding <link rel="alternate" hreflang="..." href="..."> elements to the <head> of each page. For HTML pages this is the most readable approach, but the head grows as the set grows. For a side-by-side comparison of the three methods, read the implementation methods article.

HTTP response headers

For non-HTML files such as PDFs, hreflang can be delivered in the HTTP response header. This is the practical way to declare language versions of documents. For details, see the article on adding hreflang to PDFs via HTTP headers.

XML sitemaps

On large sites, hreflang can be declared in bulk inside an XML sitemap. Managing the set in one file reduces per-page HTML maintenance. Make sure the sitemap covers every version and that every address in it is correct.

WordPress and multilingual plugins

On WordPress, multilingual plugins can generate hreflang automatically. Still, check the output: plugin updates and new pages can break the set. For installation and validation steps, see the WordPress hreflang setup article.

Validation and monitoring

Validation matters as much as implementation. Turn these steps into a routine:

  1. Crawl your site, collect each page, and extract its hreflang values.
  2. If tags are added by JavaScript, also check the final HTML rendered in a browser.
  3. Verify the return links for every address in a table.
  4. Monitor the indexing reports and the URL inspection tool in Google Search Console for the relevant pages.
  5. Review server logs periodically for requests and redirects coming from different markets.

These checks are especially valuable when the content team adds new pages, because they catch mistakes before they accumulate.

Common misconceptions

Does hreflang raise rankings?

Not directly. Its purpose is to show the right language version to the right user. That can indirectly improve user experience and conversions, but it is not a ranking guarantee on its own.

Is adding hreflang for every language enough?

No. The language code must be correct, return links must exist, and the pages must be indexable. Adding tags alone does not solve missing translations or broken addresses.

Does translating a page make hreflang work automatically?

It does not. Even when translation is complete, the set has to be built, codes verified and the page checked after publishing. Skipping these steps can waste the value of the translation.

Conclusion and next step

hreflang is one of the most important agreements a multilingual site makes with search engines. Writing language and region codes correctly, building return links and making a deliberate x-default decision prevent most problems.

As a next step, list every language version of your site. For each one, check the code, the return link and its indexability. Start with the pages that receive the most traffic. A small, regular check often makes more difference than a large one-off restructuring.

FAQ

Frequently Asked Questions

  • What is hreflang?

    hreflang is an HTML annotation that tells search engines which language and optional region a page targets, and where the other language versions of the same content are located. It helps show the right version to the right user on multilingual sites. Google treats it as a hint rather than a strict directive.

  • Why does hreflang matter?

    When the same content exists in several languages, search engines may struggle to decide which version to show to which user. hreflang defines these relationships explicitly. Implemented correctly, it reduces the chance that a wrong-language page appears in results.

  • How do you write an hreflang code?

    The language code is two lowercase letters following ISO 639-1, such as tr or de. If a region is needed, add a hyphen and an ISO 3166-1 Alpha-2 country code, such as tr-TR or en-GB. For the United Kingdom use en-GB, not en-UK.

  • When should you use x-default?

    x-default names the fallback page shown when the user's language matches none of the versions. A language selector page or your broadest version usually fills this role. It is optional, but it should be a deliberate decision applied consistently.

  • Why are return links required in hreflang?

    If one page points to another language version, that version must point back. One-way annotations do not create a reliable relationship and can make the set harder for search engines to trust. Each page should also include its own address in the set.

  • Is hreflang a ranking factor?

    It is not a direct ranking booster. Its purpose is to show the correct language version to the right user. It can indirectly improve user experience and conversions, but it does not guarantee rankings on its own.

  • Where can hreflang be implemented?

    There are three methods: as link elements in the page head, through HTTP response headers (especially useful for non-HTML files such as PDFs), and in XML sitemaps in bulk. The best choice depends on your technical setup and content type.

  • How do you find hreflang errors?

    Crawl your pages to extract hreflang values, verify return links in a table, and monitor indexing reports and the URL inspection tool in Google Search Console. A pre-publication checklist and re-validation whenever new pages are added keep errors from building up.

Related Articles

No comments yet

Leave a Comment