Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 - -
- - - - - - -

Supporter timezone: Asia/Yerevan (GMT+04:00)

This topic contains 4 replies, has 2 voices.

Last updated by Christopher Amirian 1 year, 11 months ago.

Assisted by: Christopher Amirian.

Author Posts
July 8, 2023 at 4:59 pm #13971809

michaelL-157

Hi, we’re building a website in Latin America, wanting to target multiple countries and do a subfolder for each one. The language will be Spanish on each of them, but we want the hreflang added correctly to each separate folder.

Eg /peru/, /mexico/, /colombia/, etc – all need a separate language-location code, like es-pe, es-mx, es-co.

The content does not need translating and will be slightly different on each folder. It will almost be like a separate site on each folder (same design).

How can I make WPML designate the correct hreflang to each folder like this?

Hopefully this makes sense 🙂 thanks

July 9, 2023 at 2:22 am #13972247

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi there,

WPML does not have tools to create sub folders for regions like you described.

The only tool that you have at hand is the custom language which you can use to your advantage:

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

That way you will have a language for each region and you can set the HREFLANG option in the language table as mentioned in the shared document above.

For the content of those custom languages you can decide what to do with them following the steps mentioned in the documentation below:

https://wpml.org/documentation/translating-your-contents/displaying-untranslated-content-on-pages-in-secondary-languages/

Those are the tools that WPML have. It is not specific for your use-case and you kind of use the tools to trick to have something similar.

Hope it helps.

July 10, 2023 at 9:36 pm #14009389

michaelL-157

Hi,

So far I am managing to add custom languages one by one and it seems to be working.

However I somehow messed up one: I called it Argentina but use code ve instead of ar. How can I edit either the name or the code?

I haven't used it yet so I don't understand why I can't delete it either.

Why do some of the languages have a delete button and others do not?

Thanks

July 11, 2023 at 1:02 pm #14015315

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi there,

Please make sure that you do not have that language as the default language.

If the problem persists, I'd appreciate it if you could give me the URL/User/Pass of your WordPress dashboard after you make sure that you have a backup of your website.
It is absolutely important that you give us a guarantee that you have a backup so if something happens you will have a point of restore.

Make sure you set the next reply as private.

July 12, 2023 at 6:44 am #14019163

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi there,

Thanks, I clicked the Add/Remove languages button and unchecked the Venezuela item and saved and now it is not showing in the edit languages list.

Please consider that for Argentina you can not use the ar code as it is reserved in WPML for Arabic language.

For more information:

https://wpml.org/documentation/getting-started-guide/language-setup/pre-configured-languages/

In general, I suggest that you avoid using the reserved codes for languages listed here:

hidden link

For example, a common mistake people do is to add a custom language for Bulgarian and add BE as the code.

It will work ok, but as BE is reserved for Belarussian language, sometimes you will see in the Chrome browser that the pages in Bulgarian are suggested to be translated in Belarussian.

Thanks.

The topic ‘[Closed] Assign hreflang to multiple subfolders, in same language but different country’ is closed to new replies.