Multilingual Website HREFLANG Tag Getting Started Guide

If your website business has involved multiple countries, it is necessary to build a website that contains multiple languages, then it is necessary to talk to the hrelang tag.

This is what you will learn in this article:

What is hreflang? Why is HREFLANG important to SEO? What is the HREFLANG tag? HREFLANG implementation Basics 1: hreflang tag is a two-way rule 2: Self-reference hreflang attribute is a good habit rule 3: It is recommended to use the X-Default label, but not a mandatory tag how to implement HREFLANG tag? 1. Implement HREFLANG tags with HTML 2. Implement HREFLANG HTTP header 3. Implement HREFLAN in the XML website map

What is hreflang?

HREFLANG is an HTML property that specifies the language and geographic area of ??the web page. If you have multiple versions on the same page, you can use the HREFLANG tag to tell these changes to Google and other search engines. This helps them provide the user with the right version.

For example, if we search for the “Apple Official Website” in the United States, this is the first result:

If we do the same thing in Spain, we will see the following versions of the page:

Why is HREFLANG important to SEO?

If you spend a lot of time to translate the content into multiple languages, you will want the search engine to display the most suitable version to its users. GOOGLE and YANDEX have supported HREFLANG labels. However, the Ben will not support HREFLANG tags. They use the Content-Language HTML attribute.

HRELANG’s importance of SEO:

For a better user experience. The content created for audiences and provided in its own language will resonate, attract and meet the search expectations of users. This leads to a lower hop yield and a better page rank.

In order to prevent duplicate content issues. If your webpage has the same content of different languages ??or area-specific content with the same language, Google may not be able to understand and treat it as duplicate content, which may affect page rankings. Like the specification label, Hreflang helps avoid penalties related to repeated content across the global site.

What is the HREFLANG tag?

HREFLANG marks use simple and consistent grammar:

The following is the meaning of each part of the code:

Lin Rel = “alternate”: The link in this tag is an alternate version of this page.

hreflang = “x”: It is another language because it is another language, and the language is X.

HREF = “”: The standby page can be found on this URL.

Foundation of HREFLANG implementation

The HREFLANG mark is quite simple, and May has organized three implementation methods. However, no matter which method you choose, you must always remember three golden rules.

Rule 1: hreflang tag is two-way

Understanding the hreflang tag must be used, this is critical. In other words, if you add a HREFLLANG tag to the English page to Italian version, it must return to the preference of the HREFLANG tag with the English page.

Rule 2: Self-reference hreflang attribute is a good habit

Google Statement “Every language version must list yourself and all other language versions.” For simple English, this means that each page should have a self-reference HREFLANG tag, that is, a mark pointing to itself.

Therefore, if we want to add a HREFLLANG label between the English page ( and Italian page (, these two pages should have the following hreflang Label:

The first specified page is ready to use the Italian version of the URL, and the second specifies the self-reference tag to point to the page itself.

The Italian page also needs these two hreflang labels.

Rule 3: It is recommended to use the X-Default label, but not a mandatory label

The HREFLANG X-Default tag specifies the default or backup page. When there is no other suitable language version, the page will be displayed to the user. You don’t have to use them, but Google recommends you, as follows:

How to implement hreflang tags

There are three ways to implement hreflang properties:

HTML tag

HTTP header


1. Implement HREFLANG tags using HTML

If you are not familiar with HREFLANG, use basic HTML tags that may be the easiest and fastest implementation. What you need to do is to add any suitable HREFLANG tags (as described above) in the tag of the web page. This is the URL of all three variants:




In order to properly implement the HREFLANG tag in this setting, we add the following code to each page:

Use WordPress?

HTML HREFLLANG tags can be implemented in a few seconds using the Hreflang Tags Lite WordPress plug-in.

2. Implement HREFLANG HTTP header

For non-HTML pages (eg, PDF), hreflang cannot be implemented by placing tags in HTML. The reason is that there is no HTML. In this case, the relative language of the document variant can be specified using the HTTP header. This method can also work normally on a normal page, but more commonly used in other content types.

Or the above example, just the page content is replaced with PDF.

The following is an HTTP header of each file:

HTTP / 1.1 200 OK Content Type: Application / PDF Link: ; rel = “alternate”; hreflang = “x-default”, ; rel = “alternate”; hreflang = “en”, ; rel = “alternate”; hreflang = “de “, ; rel =” alternate “; hreflang =” zh-cn “

3. Implement HREFLANG in the XML website map

Site Maps can contain associated tags to specify hreflang and variants of the page. To do this, you can use the XHTML: LINK attribute.

Example: If we continue to use the above example, this is the full code of the site map:

This seems to be able to achieve the low efficiency of hreflang attributes, the worst way; but the fact is just the opposite. The reason is that all content is defined in a file. You do not need to edit multiple HTML documents each time you change or delete the page.

In addition, adding code in the HTML head tag or HTTP header means that a large number of HREFLANG tags may affect your site speed, and the implementation of the site map does not cause the same speed to fall.