WPML Hreflang: Adding Language Tags to Your WordPress Site

If you have a multilingual WordPress site, then you know how important it is to properly set up language tags, or hreflangs.

Hreflangs are tags that tell search engines which language versions of your website to display to users based on their location and language preference. 

In this article, we will discuss how to add hreflangs to your WordPress site using WPML, a popular translation plugin.

WPML Hreflang
Written by
Table of Contents

Affiliate Disclosure: Some links of products or services will send you to partner websites where we might get a commission by recommending their product & service. 

What is a Hreflang tag and how does it help a website translation?

wpml logo

Best Translation Plugin for Content Sites

The hreflang tag is a code added to the HTML of a website that helps search engines determine the language and intended audience of a page.

This tag is particularly useful for websites with multiple versions of the same content in different languages.

By including hreflang tags, a website can ensure that the correct version of a page appears in search results for users who speak that language.

This not only helps with search engine optimization, but also helps to provide a better user experience for international visitors.

In addition, having hreflang tags can help prevent like duplicate content issues, which can negatively affect a website’s ranking. 

Overall, including hreflang tags is an important step in ensuring that a website’s content is correctly and efficiently translated for an international audience.

What is WPML and How Does it Work with Hreflang?

WPML is a plugin that allows you to translate your WordPress site into multiple languages. It works by creating language-specific versions of your site, which can be accessed by users through a language switcher. When it comes to hreflangs, WPML makes it easy to add language tags to your site.

Adding Hreflangs to Your WordPress Site with WPML

To add hreflangs to your WordPress site using WPML, you will need to follow these steps:

Using Tags to Set Hreflangs in WPML

To set up different hreflangs from the default ones in WPML, you will need to change the tags. Tags are essentially placeholders for language codes and locale information. Here are some examples of tags you may need to use:

  1. {LANGUAGE} – this tag will be replaced with the language code (e.g. en for English, fr for French, etc.).
  2. {COUNTRY} – this tag will be replaced with the country code (e.g. us for the United States, ca for Canada, etc.).
  3. {LOCALE} – this tag will be replaced with the locale information (e.g. en_US for English spoken in the United States, fr_CA for French spoken in Canada, etc.).
You will need to do the follow steps to do the changes:

Duplicate Content and Hreflangs

If you have duplicate content on your site (i.e. content that is the same in multiple languages), then you will need to be careful when setting up hreflangs. Duplicate content can cause issues with search engines, so it is important to use the correct hreflangs to avoid any penalties.

Getting Help with WPML Hreflangs

If you need help setting up hreflangs on your WordPress site using WPML, then there are plenty of resources available. The WPML website has a wealth of information on how to use the plugin, including specific instructions on how to set up hreflangs. Additionally, there are many WordPress developers and experts who specialize in WPML and can help you with any issues you may encounter.

The Benefits of Using Hreflangs with WPML

Using hreflangs with WPML can have many benefits for your WordPress site. Here are just a few:

Overall, using hreflangs with WPML can help you create a more user-friendly, SEO-friendly, and globally-minded website that can help you achieve your business goals.


Adding hreflangs to your WordPress site using WPML can seem daunting at first, but it is an essential step in creating a multilingual website that can reach users from different parts of the world. By following the instructions outlined in this article and using the resources available, you can set up hreflangs on your site and reap the benefits of a multilingual presence. Whether you are looking to improve your SEO, increase your traffic, or expand your business internationally, using hreflangs with WPML can help you achieve your goals and connect with a global audience.

More about Content Creation