Inicio > Digital Marketing Dictionary > SEO > Alternate/hreflang link element

Published on 01/15/2020

·

Updated on 02/03/2020

Alternate/hreflang link element

Merche Martínez

SEO Consultant

In 2011, Google introduced the hreflang link element to indicate alternative pages with similar content in different languages and/or markets. In 2013, the x-default attribute value was introduced, used when the version does not match any specified language or region.

Would you prefer to watch the video of this definition? We leave it here:

When to use hreflang

Google recommends using alternative pages in the following cases:

  • If the main content is not translated for the same page in different versions, it is considered duplicate content even if the common header and footer content is translated. In this case, it is recommended to define the alternate page for each version using alternate/hreflang.
  • Content for different versions of the same language. For example, Spanish pages for Spain and Mexico.
  • Equivalent pages in different versions and languages.

Whenever there is a multi-language website, we recommend using the hreflang link tag to indicate the equivalent pages of each version.

How to use

The hreflang link element supports the language codes defined in the specification ISO 639-1 and the region codes defined in the ISO 3166-1 alpha-2 specification. You can define the content for a language without depending on a region, for a language in a specific region or a default version. You cannot use the hreflang link element to specify only one region.

Here are some examples:

  • hreflang=”es”: content in Spanish, without identifying a specific region.
  • hreflang=”es-ES”: Spanish content aimed at users in Spain.
  • hreflang=”es-MX”: Spanish-language content targeted to users in Mexico.
  • hreflang=”x-default”: defines a default version for users whose browser settings do not match any specified language or region. The use of this attribute is not mandatory.

In languages such as Chinese, which has variations in its alphabet, it can be specified using the code ISO 15924.

  • hreflang=”zh-Hant”: content in traditional Chinese.
  • hreflang=”zh-Hans”: content in simplified Chinese.
  • hreflang=”zh-Hant-TW”: content in traditional Chinese for Taiwanese users.
  • hreflang=”zh-Hans-TW”: simplified Chinese content for Taiwanese users.

Ways to specify the alternate/hreflang link element

There are different options to indicate alternative pages:

Define alternate/hreflang with HTML tags

Within the <head> of each page a <link> tag must be included to specify the URL corresponding to each version, including that of the page itself. The format would be <link rel=”alternate” hreflang=”language_code/language_code/region_code” href=”url_page”>.

Define alternate/hreflang tags with HTTP headers

This option is recommended for non-HTML files, such as PDF files.

The format would be: Link: <url>; rel=”alternate”; hreflang=”language_code/language_code/region_code”, <url_version2>; rel=”alternate”; hreflang=”language_code/language_code/region_code”, …

Define alternate/hreflang tags with sitemap

In the sitemap file you can define the different equivalent versions for each language/region.

Inside the tag <url> you must include: <xhtml:link rel=”alternate” hreflang=”language_code/language_code/region_code” href=”url_page” /> for each version.

References

https://developers.google.com/search/docs/specialty/international/localized-versions?hl=en

Tu marca, visible y encontrable

Estás a un paso de dominar tu categoría online

Start now
Merche Martínez

SEO Consultant

Former SEO Consultant at Human Level. A graduate in Computer Engineering, she has completed various specialization courses in usability, layout design, and database optimization. She is a specialist in national and international SEO and also holds the Google AdWords certification.

SHARE THIS POST

Content owned by Human Level

The content of this website is copyrighted and is property of © 2001-2026 Human Level Communications S.L.U.

Join the conversation

Fields marked with * are required.

Related terms

16 Sep 2020

302 redirection

What is a 302 redirection? A 302 redirection indicates that the content of a page has been temporarily moved...

Anastasia Kurmakaeva

Let's Talk!

Tell us more about your project and how you think we could help you. Improving your online visibility and conversion is just a click away.

Contact

+34 966 141 907
info@humanlevel.com

Our Schedule

Mondays to Thursdays from 8:00 to 18:30
Fridays from 8:00 to 15:00

    Fields marked with * are required






    In this form, we collect personal data in order to contact you and process your request in accordance with our services. The data controller is HUMAN LEVEL COMMUNICATIONS S.L.U. For more information on how we treat your data and to exercise your rights, you can consult our Privacy Policy.

    Terms acceptance and newsletter subscription