Google indexing

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Hi there
version 3.9

Does anyone have any info on how google indexes your site when you have multiple languages set up?

I have a site targeting spain (.es) but also have french, english and dutch languages set up on the site.

Id like google to only index the .es pages in spanish. is this possible?

Ive tried turning off the other languages via the admin panel but then the site doenst work correctly.
it only displays the standard language and not spanish. which is vert annoying...!

thanks !
6 years ago
Hello-

I'm not 100% positive, but I am pretty sure Google and the other engines look for a language/culture directive on the HTML tag,

This is English/United States:
<html lang="en-US">


...or, for Spanish/Spain:
<html lang="es-ES">


https://www.w3schools.com/tags/ref_country_codes.asp

To add this to your site, you'll need to add the directive to your HTML tag in the view:
/Views/Shared/_Root.Head.cshtml

At about line 35, you'll see something like this:
<html@(this.ShouldUseRtlTheme() ? Html.Raw(" dir=\"rtl\"") : null) @Html.NopPageCssClasses()>


...change it to this:

<html@(this.ShouldUseRtlTheme() ? Html.Raw(" dir=\"rtl\"") : null) @Html.NopPageCssClasses() lang="es-ES">


..or maybe this:
<html lang="es-ES" @(this.ShouldUseRtlTheme() ? Html.Raw(" dir=\"rtl\"") : null) @Html.NopPageCssClasses()>
6 years ago
I'm more asking / hoping nopcommerce has a built in feature or if anyone knows of a solution, it must affect every nopcommerce site that is multilingual.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.