Inhoudsopgave

What is the hreflang tag?

Hreflang tags help search engines display the correct language version of your website to the right audience. When you have different language and regional versions of a page, hreflang tags ensure that users see the version that best matches their language or location. This is important for international websites that offer the same content in multiple languages or in different countries. Hreflang tags help prevent duplicate content and indexing issues by enabling search engines to better determine where your international pages should be displayed.

An example of hreflang tags

How do hreflang tags work?

The hreflang tag is placed in the HTML of each page. It specifies the language—and, if applicable, the region—that the page is intended for. A page for Dutch users is assigned the tag hreflang=”nl”, while an English page for users in Great Britain is assigned the tag hreflang=”en-gb”. This helps search engines display the correct version of your page in search results.

An hreflang tag contains one or two ISO codes:

  • A language code: hreflang=”nl”.
  • A language and region code: hreflang=”nl-be”.

The first code in an hreflang tag is the ISO code for the language, such as “Nederlands” in this example. Other commonly used codes are “en” (English), “de” (German), “fr” (French), and “it” (Italian).

The second code is the ISO code for the region. In the example hreflang=”nl-be,” this is “be,” which refers to Belgium. This indicates that the page is in Dutch and specifically targeted at users in Belgium.

It is important to note that an hreflang tag cannot contain only a region code; doing so will invalidate the hreflang tag. Therefore, always use either a language code or a combination of a language code and a region code.

You can find a complete list of hreflang tag codes on the Hreflang.org website, among other places.

The hreflang x-default tag

The x-default hreflang tag is the fallback version of your page. This tells search engines which page to display when a user’s language or location does not match the hreflang tags you’ve specified. Thanks to the `hreflang=”x-default”` tag, a search engine can still display a search result to relevant users.

How do you properly implement hreflang tags?

Proper implementation of hreflang tags is important for your international SEO. It helps ensure that the correct version of your pages is displayed and prevents confusion for search engines and visitors. To set up hreflang tags correctly, follow the steps below.

1. Determine the correct language and region codes

Use the ISO 639-1 code for the language, such as “nl” for Dutch. Do you want to target a page specifically to a certain region? Then combine it with an ISO 3166-1 region code, such as “nl-be” for Dutch-language content targeting Belgium. By determining which parts of your websites are targeted at which languages and/or regions, you’ll know the correct ISO codes.

2. Add hreflang tags to the HTML

Place the hreflang tags in the -section of each page. Add a separate tag for each language and regional variant of the page, so that search engines know exactly which version corresponds to which target audience. For example:

3. Use the x-default as a fallback

The hreflang=”x-default” is the fallback version of your page. This is useful for visitors who do not have a specific language or region preference. The href=”” value can also be a homepage or language selector; in our example, we’ve chosen the English version of the blog.

4. Use self-referencing hreflang tags

Each language variant of a page must contain an hreflang tag pointing to itself (a self-referencing hreflang tag) and to other pages. In this case, we’ll place the code above on both https://smartranking.nl/blog/ and https://smartranking.nl/en/blog/.

5. Conduct an audit to identify errors

Once you’ve implemented your hreflang tags, manually checking everything is usually a lot of work. That’s why you should use tools like SE Ranking, Ahrefs, or ContentKing to check and monitor your hreflang tags (sometimes even in real time). You can then fix any errors yourself or in collaboration with developers.

Hreflang Tags in the XML Sitemap

Do you have a large website with tens of thousands of pages? If so, adding hreflang tags to your XML sitemap is also an option. This allows you to keep all variants of a page organized in one central location. Here’s an example in XML:

Bing and hreflang tags

In addition to Google, Bing now also uses hreflang tags. It’s important to note that Bing is slightly less strict about hreflang tags than Google. For proper indexing, however, it’s important to set up the hreflang tags correctly according to ISO standards, so that all search engines can properly understand your website’s international structure.

Tools for Implementing hreflang Tags

When you use popular SaaS platforms, such as WordPress, Shopify, and Magento, there are effective solutions for implementing hreflang tags. The most commonly used tools are:

Growing with International SEO

Once you’ve implemented your hreflang tags, you’ll have laid an important technical foundation for growing your business through international SEO. Are you hitting a ceiling and ready to take the next step? Feel free to contact us—as an SEO agency, we’d be happy to help you with your international growth.

Jarik Oosting

This article is written by Jarik Oosting

With a passion for SEO and an unmatched drive for results, Jarik Oosting is the driving force behind SmartRanking. With over 15 years of experience in the field, he has built an extensive body of knowledge spanning technical SEO to complex site migrations. As the founder of SmartRanking, he has assembled a team of like-minded SEO specialists who help businesses achieve sustainable online growth.

His academic background in information science at the University of Groningen, with a specialization in natural language processing, gives him a unique perspective on the world of SEO. For Jarik, it’s not just about visibility in search engines, it’s about sharing knowledge and guiding businesses toward sustainable online success. That mission also led him to write a Dutch book about GEO.

More about SmartRanking