Is it useful to declare website language?

M4DM4X

Elite Member
Joined
Jan 21, 2015
Messages
2,909
Reaction score
1,754
Hi,
I'm launching a site in Portuguese should I state the language with the tag <html lang="">... </html> or Google will display it automatically in countries where this language is spoken, based on the visitor's ip (on this case Portugal and Brazil)?
Should I specify countries too?
Thanks
 
Hi,
I'm launching a site in Portuguese should I state the language with the tag <html lang="">... </html> or Google will display it automatically in countries where this language is spoken, based on the visitor's ip (on this case Portugal and Brazil)?
Should I specify countries too?
Thanks
To make sure search engines and browsers understand the language of your website, it's a good practice to specify the language using the lang attribute in the HTML tag. For Portuguese, you can use pt for the language code.

<html lang="pt">
<!-- Your website content -->
</html>
While search engines like Google can often detect the language based on content and visitor location, explicitly specifying the language helps ensure that your website is correctly categorized. It's especially important if your content is in a language that's widely spoken in multiple countries with variations, like Portuguese in Brazil and Portugal.

In addition to specifying the language, you may also use the 'hreflang' attribute in your HTML tags to indicate regional variations of the language. For example:
<link rel="alternate" hreflang="pt-BR" href="https://www.example.com/pt-BR/page">
<link rel="alternate" hreflang="pt-PT" href="https://www.example.com/pt-PT/page">
This tells search engines that you have specific content for Portuguese speakers in Brazil and Portugal, helping them deliver the most relevant results to users in those regions.

While specifying the language and region can be beneficial for search engine optimization and user experience, it's not mandatory. Search engines can still detect the language and display relevant results based on the visitor's IP and other signals. However, explicitly setting the language and region is a best practice to ensure your website is correctly understood by search engines and properly categorized for search results.
 
Google usually does a good job of recognising what non-English territories it will display results in from the language used in the content alone, but it certainly doesn't hurt to give a pointer of a lang attribute, in your case
Code:
<html lang="pt">
 
It is considered good practise is to declare lang, will it make a big difference. No not really.
 
To make sure search engines and browsers understand the language of your website, it's a good practice to specify the language using the lang attribute in the HTML tag. For Portuguese, you can use pt for the language code.


While search engines like Google can often detect the language based on content and visitor location, explicitly specifying the language helps ensure that your website is correctly categorized. It's especially important if your content is in a language that's widely spoken in multiple countries with variations, like Portuguese in Brazil and Portugal.

In addition to specifying the language, you may also use the 'hreflang' attribute in your HTML tags to indicate regional variations of the language. For example:

This tells search engines that you have specific content for Portuguese speakers in Brazil and Portugal, helping them deliver the most relevant results to users in those regions.

While specifying the language and region can be beneficial for search engine optimization and user experience, it's not mandatory. Search engines can still detect the language and display relevant results based on the visitor's IP and other signals. However, explicitly setting the language and region is a best practice to ensure your website is correctly understood by search engines and properly categorized for search results.

Thank you much mate for this detailed reply, very much appreciated.
I'm interested in using the hreflang tag but as you put it I need different pages to point BR visitors and PT visitors to. But it's the same language so I don't understand how I can different pages, do I have to rewrite the content for each country?
Or can I just use <hreflang=''pt"> at the beginning of my html page and that's all?
Google usually does a good job of recognising what non-English territories it will display results in from the language used in the content alone, but it certainly doesn't hurt to give a pointer of a lang attribute, in your case
Code:
<html lang="pt">
Thank you much for your help mate.
Do you know which one is better for seo, html lang or <hreflang=''pt"> ?
 
Doesn't hurt to implement the code.

I did research back in the days, lang or hreflang all does the job, no big differences.
It's just a declaration, google can figure out your page language.

I personally add a <html lang="en">
 
Thank you much for your help mate.
Do you know which one is better for seo, html lang or <hreflang=''pt"> ?
You want to use the
Code:
<html lang="pt">
version, as hreflang is more for giving pointers if your site is in multiple languages, eg
Code:
<link rel="alternate" href="http://japan.example.com" hreflang="ja">
would specify the location of a japanese version
 
Thank you much mate for this detailed reply, very much appreciated.
I'm interested in using the hreflang tag but as you put it I need different pages to point BR visitors and PT visitors to. But it's the same language so I don't understand how I can different pages, do I have to rewrite the content for each country?
Or can I just use <hreflang=''pt"> at the beginning of my html page and that's all?

Thank you much for your help mate.
Do you know which one is better for seo, html lang or <hreflang=''pt"> ?
I'm glad you found the previous information helpful!

For the hreflang tag, it's typically used when you have content that's in the same language but targeted at different regions or countries. You don't necessarily need to rewrite the content entirely, but you should consider providing region-specific information or localizations, such as contact details, pricing, or regional differences, where applicable.

Using <link rel="alternate" hreflang="pt" href="URL"> in your HTML head section informs search engines that there are alternative pages for Portuguese-speaking users, such as those from Brazil and Portugal. This helps search engines understand the geographical targeting of your content.
 
It depends on where most of my customers are. If 70%+ are in English speaking countries, I just leave it as English and put a drop-down non-obstrusive language translator widget on the navigation menu bar.

I am more about the user experience in this case, and let Google do it's job. In your case pt href lang sure does help if your site is in English and you're serving Portuguese visitors mostly. I think there would be no additional benefits using the tag if your site is already written in Portuguese tho adding it certainly won't hurt. I bet the big G algo is smart with language classification problems.
 
Hi,
I'm launching a site in Portuguese should I state the language with the tag <html lang="">... </html> or Google will display it automatically in countries where this language is spoken, based on the visitor's ip (on this case Portugal and Brazil)?
Should I specify countries too?
Thanks
You should specify the language using the <html lang=""> tag. Google can interpret this information to understand the language of your site. While Google may consider the visitor's IP, specifying the language in the code is a best practice to ensure proper language targeting. You don't need to specify countries within the HTML tag; specifying the language is sufficient.
 
Yes, it is useful to declare website language. Doing so allows content to be served in the correct language and helps search engines to index the site correctly for users who are searching for language-specific content.
 
İt helps you to reach higher ranks on browsers on that language as i know, but it can affect global ranking.
 
Back
Top