Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
You are developing a multi-regional site targeting Spanish-speaking countries and want to ensure that your WPML configuration aligns with Google's guidelines for managing multi-regional sites. You are uncertain if the current configuration of WPML components like language name, code, default locale, encode URLs, and hreflang meets these guidelines.
Solution:
We have reviewed your WPML configuration and it appears you have correctly added the custom languages. However, for Chile, you should use the language code "es-cl" instead of "cl". If you haven't added any content yet, you can delete the existing custom language and add a new one with the correct "es-cl" language code. For more detailed guidance on editing WPML's languages table, please refer to our documentation here: Editing WPML's Languages Table.

If this solution does not apply to your case, or if it seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. Should you need further assistance, please do not hesitate to open a new support ticket at WPML Support Forum.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 5 replies, has 2 voices.

Last updated by Itamar 3 months, 1 week ago.

Assisted by: Itamar.

Author Posts
September 8, 2024 at 12:54 am #16151922

manuelV-19

Background of the issue:
I'm developing a multi-regional site targeting several countries where the audience speaks Spanish. I want to personalize parts of the content for each specific country to make it more relevant and impactful. I am trying to match Google's official information with WPML to avoid mistakes that could hurt my business results. I reviewed Google's guidelines on managing multi-regional sites and want to ensure I configure WPML correctly, including language name, code, default locale, encode URLs, and hreflang.

Symptoms:
Uncertainty about whether the current configuration of WPML components (language name, code, etc.) meets Google's guidelines.

Questions:
Am I doing things correctly with the current configuration of WPML components as shown in the uploaded image?
Is there a resource or documentation that explains each WPML field and its impact on Google's guidelines in a way that is easy to understand for beginners?

September 8, 2024 at 8:02 pm #16153132

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

As far as I can see, you added the custom languages correctly. I can also verify this according to other sources I've found here.

hidden link

hidden link

This is our relevant guide to creating custom languages.

https://wpml.org/documentation/getting-started-guide/language-setup/editing-wpmls-languages-table/

There is one exception that you may want to correct. For Chile, the language code you put is "cl", and you might want to consider using "es-cl". If you have not added any content, you can delete this custom language and add a new one with the "es-cl" language code.

Regards,
Itamar..

September 9, 2024 at 2:27 am #16153361

manuelV-19

Thanks for the quick reply Itamar and great that you noticed the Chile scenario. I did that in purpose to see the implications of the "code" field. From my perspective, I saw that it affects the urls directories but, is it the only implication or does it affect other things. I made the Chile scenario to see if I could emulate Google's guidelines regarding "locale-specific URLs" where "Subdirectories with gTLD" only include the region (country), not the language. See hidden link .
So, my question is if I should configure the WPML "code" only with the region/country to comply with Google's guidelines about Subdirectories with gTLD or, as you suggested, besides the region, add the language: "cl" VS "es-cl" in code field.
How does WPML uses the code field. Only for the url structure or something else?

September 9, 2024 at 8:27 am #16154421

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

WPML uses the language code also for the "hreflang".

Hreflang tags are HTML attributes that indicate the language and region a page is intended for. In a multilingual website, hreflang tags tell search engines the intended audience for each version of a page.

Please read about it in detail in our guide here.

https://wpml.org/documentation/support/adding-hreflang-wordpress/

Notice the following we mention that is directly related to your case.

As you can see, hreflang tags use a two-letter code when referring to languages. In this example, es stands for Spanish (Español). For the full list of abbreviations, visit the language code standards – ISO 639-1.

To indicate a language and target region, like Spanish-Mexico, you add the country code to the end of the hreflang component, like this:

hreflang="es-mx"

In this example, es stands for Spanish, and mx for Mexico. Country codes follow a similar two-letter abbreviation to language codes based on the ISO 3166-1 alpha-2 standard.

When adding hreflang tags to your website, it’s important to follow Google’s recommended hreflang guidelines outlined below.

In my humble opinion, since your site has a few versions of the Spanish language, you should use a combination of language/region. Since I'm not an SEO expert, you can consult an SEO expert.

Regards,
Itamar.

September 9, 2024 at 6:55 pm #16158532

manuelV-19

Thanks a lot Itamar for the follow up. Don't give up on me on this, hopefully, final question. The documentation you sent me, addresses the hreflang value importance along with the country attribute in order to focus on a specific region.
And as I see it, the only way to configure this is in the custom language section hreflang column. In the documentation you sent me, the hreflang value is "fr-ca". Nothing is said about the code column value.
Because of this situation, in my original example image I placed two scenarios: the Chile scenario and the rest. In this newly attached image, I'll contrast the Chile scenario (in red) against the rest which I'll exemplify with the Argentinian (in blue) custom language.
As you can see, like in the documentation you sent me, in the add a custom language section, the hreflang column's values are the one's that are impacting on the html's hreflang tags and attributes.
On the side of the Code column and values, I see that they have an impact on the URL href. For the Argentinian case, the code was "es-ar", ergo, the subdirectory appears as .../es-ar/directorio...". The Chile scenario, the code was "cl", ergo, the subdirectory appears as .../cl/directorio...".
I made the Chile scenario in order to comply with Google's reference of subdirectories with gTDL (see attached image or consult hidden link)
***I'm asking all these questions just to make sure I am fully grasping the power of WPML so it can better assist me in achieving growth goals so, although I've noticed this things and may appear that I have my own answer, I just want to make sure of the impact the "code" column and values inside " add custom languages" in WPML have. I am not a developer so I do not know if there is another implication or impact on the backend.***
Once again, I am truly grateful with you Itamar. I appreciate a lot your attention and follow up. Cheers mate!

Google subdirectories with gTDL.png
WPML Code role.png
WPML docs.png
September 10, 2024 at 12:09 pm #16161164

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

I'm sorry it was my mistake. The "hreflang" column sets the hreflang attribute. You got everything right!

Best Regards,
Itamar.