A hreflang tag tells search engines which language and region a page is intended for, ensuring that the right version is shown to the right user. It’s an essential element for websites with multilingual or region-specific content.

What is a hreflang tag?

A hreflang tag is an HTML attribute that tells search engines which language and region a specific webpage is intended for. This tag helps display multilingual or multiregional content correctly in search results and prevents the wrong language versions from being shown.

What are the benefits of a hreflang tag?

The benefits of the hreflang tag are avoiding duplicate content and showing the correct language version to the right user. By applying hreflang correctly, Google understands which page corresponds to which language or region. This ensures that search results are tailored to the visitor’s location and language, without penalizing your site for having identical or similar content on multiple pages.

Avoid duplicate content

Duplicate content can negatively impact your SEO and search visibility. Google is always looking for the best websites—ones that offer real value to its users. A site filled with duplicate content provides little value and is therefore less likely to appear prominently in search results.

When you add multiple languages to your site, there’s a good chance that much of the content will closely resemble each other. For example, Dutch and Flemish pages may appear almost identical.

To prevent Google or another search engine from flagging this as duplicate content, you should implement a hreflang tag. This tells the search engine that it’s the same content in a different language or for a different region.

Show the correct page

A website with multiple languages often uses different URLs per language. For example, the Dutch version might be www.domain.nl, while the English version is www.domain.uk. To ensure that your pages are shown in the correct countries, you need to set up a hreflang tag.

This way, a user in the UK will see the English version, and someone in the Netherlands will see the Dutch version. It helps prevent confusion and frustration.

How to set up a hreflang tag

You set up a hreflang tag by specifying the correct language and regional versions for each page in the <head> section of the HTML using <link rel=”alternate” hreflang=”…”>. This tells search engines which language and region a page is intended for, and references alternative versions. It must be done carefully per page, using the correct language and country codes.

Below, we explain how to do this in four steps:

1. Place the code in the <head>

Place the hreflang tag, just like other rel-elements, in the <head> section of the HTML source code.

2. Specify all variants

It’s important to list all language and regional versions for each page — including the page itself. If your site supports 4 languages, each page should contain four lines of code, one for each language/region combination.

3. Page-specific implementation

The hreflang tag is page-specific, meaning you must add it individually for every page.

Page A gets:
<link rel=”alternate” hreflang=”nl-nl” href=”http://www.domein.nl/pagina-A” />
<link rel=”alternate” hreflang=”nl-be” href=”http://www.domein.be/pagina-A” />

Page B gets:
<link rel=”alternate” hreflang=”nl-nl” href=”http://www.domein.nl/pagina-B” />
<link rel=”alternate” hreflang=”nl-be” href=”http://www.domein.be/pagina-B ” />

4. Use the correct coding

Make sure you use the correct language and region codes. Only then can search engines accurately interpret which version of the page applies to which audience. Here are a few examples.

The first part of the hreflang value specifies the language. If you want to display different languages based on region, you can also include the region code. This is optional.

nlDutch, regardless of country.
nl-nlDutch in the Netherlands
nl-beDutch in Belgium (Flanders)
fr-beFrench in Belgium (Wallonia)
dl-dlGerman in Germany
dlGerman, regardless of country

Make sure to implement the hreflang tag correctly. If it’s done incorrectly, search engines may misinterpret or completely ignore the tag. This can lead to various issues.