🎉 We have launched our new WordPress plug-in! Download now

The different Hreflang language codes and how to implement them

What are hreflang tags?

When it comes to international SEO, hreflang tags are an essential element to help search engines understand the different language versions of your website. If you have a website available in multiple languages, hreflang tags can tell search engines which version of your website is intended for which audience.

There are a few different ways to specify the language of your website's content, but hreflang tags are the most recommended method. Hreflang tags are HTML tags that look like the following:

<link rel="alternate" hreflang="x" href="http://example.com/">

The "x" in the hreflang tag can be one of the language codes listed in the text. These language codes are used to indicate which language version of a Web site is intended for which audience. Hreflang tags are primarily used to specify which URL the user should be redirected to the version of the Web site written in their language. Hreflang tags can also be used to specify the same URL for multiple languages, such as when a Web site is available in both English and French.

Implementation Hreflang tags

There are several ways to implement hreflang tags on a Web site. They can be added to the HTML code of each page of the website or in the HTTP header of the website. Hreflang tags can also be added in the Google Search Console or through the use of the Sitemap format. It is important to ensure that hreflang tags are implemented correctly, as this can help improve a website's search engine ranking and ensure that users are redirected to the correct language version of the website.

In most cases, you will want to specify a different URL for each language version of your website. In the example above, the "href" attribute is replaced with the URL of the corresponding language version of your website.

If you don't have a specific page for a particular language, you can leave the "href" attribute blank. For example, this hreflang tag would tell search engines that there is no French version of this page:<link rel="alternate" hreflang="fr" href="">

In some cases, you may want to use the same URL for multiple languages. This is common if you have a bilingual Web site, or if you have separate pages for each language, but the content is largely the same. In these cases, you can use the "hreflang" attribute to specify multiple languages for the same URL. For example, this hreflang tag would tell search engines that this page is available in both English and French:<link rel="alternate" hreflang="en-za" href="http://example.com/"> <link rel="alternate" hreflang="fr" href="http://example.com/">

You can also use the "hreflang" attribute to specify the "x-default" language. The "x-default" language is used to tell search engines which language version of your Web site to display if no other language version is appropriate. Although it is not necessary to use it, Google recommends its use.

Set language tags at Clonable

When you have subscribed to Clonable you will receive an email from us containing the DNS records and language tags that need to be changed. By adding these language tags, Google and other search engines will see your clone as an original site, rather than duplicate content.

There are several ways to set language tags. Depending on your platform, this script needs to be pasted in different places. In the mail (and later also in the backend of Clonable) you will find a short instruction on where exactly to paste the snippet.

When you purchase a new clone from us, we will send you an email about how to set up the language tags. This is different for each platform. We will make sure you get the right script with the right instructions to set the language tags correctly. It is easiest to copy the script verbatim from the email, when you try to type it over it may contain spelling errors or missing parts, causing the script not to work.

You can also review the instructions for the language tags at a later time, for example, if you want to re-enable them after disabling them. When the clone is completed, you can find the instructions in your Clonable environment. The instructions and details for your clones can be found by going to the clone settings in the Clonable dashboard and then clicking on the Setup information tab. At Language tags, click on the link under Setting up your language tags. A window will then appear where you can choose your platform. Based on that choice, you will then be presented with the required script/data.

Still have questions?

If so, please fill out the form below.

Related blogs: