The importance of Hreflang

Some websites are available in more than one language. If this is your case, implementing a language strategy will help search engines understand which language version is the best one to show users depending on factors such as their geolocation: that’s where the Hreflang comes in.

What is Hreflang?

Hreflang, like the ALT tag, is an HTML attribute that identifies which language version of a page corresponds to which language. Thanks to Hreflang, when a user performs a search for which you are positioned, the page that appears in Google’s SERP will be the one corresponding to your geolocation.

Let’s see this in an example: if a user from Spain types “roi up” in his search, the snippet that will appear is the following:

Whereas, if a user types that same keyword in the UK, the snippet will look like this:

As we can see, the results are adapted to the user’s location and, in most cases, to their native language. Adapting the languages of a website to the geolocation of each user is something we can do with the Hreflang applied to SEO, so it will be important to implement it correctly.

Hreflang for geographical areas

In addition to having the ability to identify websites by language, it can also be done by geographic area. There are several reasons why we can have a version of our website for, for example, Spain, and another for Mexico.

As in the previous example for the language version, if a user located in Mexico were to search for “roi up”, they would encounter the following SERP:

This function, in addition to taking the user to the page that was designed for him, serves to solve the possible problem of duplicate content between two texts that are made for the same language, but not for the same country.

How to implement the Hreflang tag

You already know the importance of Hreflang for your language strategy; here’s how to implement this HTML tag.

The label should be implemented using the following code:

After the hreflang= code we must put the language of the page in quotation marks. Also, optionally we can put the Hreflang for geographic zones. In the example above we see how es represents the language (Spanish) while mx represents the geographic zone (Mexico). Subsequently, we will put the URL of the page to which we are pointing in quotation marks after the href= code.

We will have to make a list with this same code for all the language versions of our web and insert it in the HTML code.

X-default, key in a Hreflang optimization for SEO

For those cases in which there is no language on the web for the user, the X-default attribute will indicate which language version we want to be displayed by default. To implement it, we will have to add to our row of html codes one like the one in the following example:

This is a line similar to the one that indicates which language and region a URL belongs to. With the difference that in that field we must write “x-default”.

INP New main metric in Core Web Vitals

A new essential web evaluation metric from Google, INP (Interactión to Next Paint), comes into play on March 12.

Read more

How AI affects SEO strategies

We have seen how the incursion of AI into search engines and the changes in the ways in which they display results in SERPs is changing and we must try to adapt to them.

Read more

Artificial intelligence (AI) and SEO: everything you need to know

How can Artificial Intelligence affect SEO? We can replace the word "SEO" with a wide variety of specialties within digital marketing and even outside of it, and we're looking at a question that has become one of the most intriguing debates of 2023.

Read more