Adding a Language code (hreflang tag)

When you publish a multi-language website, you will want to make sure people are seeing the correct pages for their location. 

Hreflang tags are small elements in your page source code used to tell search engines about pages that are similar in content but targeting different languages. The hreflang attribute (also referred to as rel="alternate" hreflang="x") tells search engine bots which language you are using on a specific page. 

There are two ways of marking such pages: 

  • Content with regional variations like en-us and en-GB.
  • Content in different languages like ende, or fr. 

For example, if you create a German-language version of your English-language homepage, you would tag it as "German" which inserts hreflang= "de". As a result, searchers with an IP address in a German-speaking country are served that page in German instead of English.

language_code_1.png

 

Hreflang can also indicate variants of a single language. You can choose the hreflang attribute with annotations that indicate which region the content is in, e.g. German hreflang="de" versus Swiss hreflang="de-ch".

 language_code_2.png

Google has a best practice guide for using hreflang tags, which you can check out here

 

How to add a Language code 

The Language code adjusts the lang attribute of the <html> tag of the page. Here’s how to implement it:

  1. Go to the Website > Pages menu and locate which page you would like to make language-specific.
  2. Click on the “cog” Page settings icon to access the Page settings area.

 Screen_Shot_2020-08-27_at_12.29.05.png

 

  1. Scroll down to the Language code area.

language_code_4.png

  1. In the drop-down menu, choose the language you want to add the hreflang tag for.
  2. Click on your selected language and then click Submit.
  3. Your Language code selection (hreflang tag) will appear in the <head> section of the page:

 language_code5.png

 

Note: When you add a new language and create a multilingual site, the language code of all pages created in a specific language is updated automatically. 

Other helpful articles

Creating multi-language site navigation

Building a page with language-specific blocks

Managing website settings

Sitebuilder in various languages

Was this article helpful?
0 out of 0 found this helpful