What is the hreflang attribute for?

Asked

Viewed 595 times

3

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

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

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

For a site that only has one language, it is necessary to include this tag?

1 answer

2


The idea of this attribute is to indicate which language of the anchor link the attribute is in. 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 the case of a site with only one language 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 detecting the language from the text of the site).

  • 1

    Thank you Sergio.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.