What is the hreflang attribute for?

3

I am interested in SEO techniques and among my searches I found the hreflang attribute. Some examples:

<!-- Dentro do HEAD -->
<link rel="alternate" hreflang="pt-br" href="...">

<!-- Dentro do BODY -->
<a hreflang="pt-br" href="...">...</a>

For a website that only has one language, does it need to include this tag?

    
asked by anonymous 13.07.2017 / 23:32

1 answer

2

The idea of this attribute is to indicate the language of the anchor link where the attribute is. This is useful in terms of SEO for the search engine to better organize content.

This attribute is usually used in conjunction with rel="alternate" to indicate that the link points to the same content, but in another language.

In case of a website with only one language, it is not necessary, then just have <html lang="pt-BR"> in the HTML tag, to indicate which language the site is in (although nowadays search engines no longer have problems in detecting the language from the text of the site).

    
13.07.2017 / 23:40