Skip Navigation

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

Problem:
You are trying to maintain a consistent URL structure between your main site and the translated version using WPML. On your main site, the URL is site.com/watch-straps/nato, but on the translated site, it changes to site.com/sv/produkt-kategori/klockarmband/nato-sv/.
Solution:
This issue is recognized as a known problem related to the Rank Math SEO plugin where turning on 'Strip Category Base' causes issues with secondary languages. We are currently working on a fix for this. In the meantime, we recommend not translating the category, product, or product-category slugs. The untranslated terms won’t be visible in the URL anyway when you use any of those options. For more details, please check the known issue here: Rank Math SEO and WPML URL structure issue.

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. If you still need assistance, please 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 19 replies, has 2 voices.

Last updated by Andrey 2 weeks, 2 days ago.

Assisted by: Andrey.

Author Posts
October 15, 2024 at 7:09 pm #16292402

rasmusN-3

Background of the issue:
I am trying to maintain a consistent URL structure between my main site and the translated version using WPML. On my main site, the URL is treband.com/watch-straps/nato, but on the translated site, it changes to hidden link.

Symptoms:
The URL structure changes between the main site and the translated version.

Questions:
How can I change the URL structure so it is the same for both the main site and the translated version?

October 15, 2024 at 7:47 pm #16292531

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

To change the product slug (URL) in the secondary language, you must first include it in the translation.

Here is an outline of the steps:

1. Go to WPML → Settings → Translated documents options and choose "Translate" (this will include the slug in the translation and not create it automatically from the title).

2. Make slight modifications to the original page and save it.

3. Go to the WPML translation editor. Now, the URL is included.

4. Make changes to the slug and complete the translation.

October 15, 2024 at 8:33 pm #16292604

rasmusN-3

Hi,

So you mean I have to go in to every single product and every single category and make a small change to be able to translate the URL after that?

October 15, 2024 at 8:40 pm #16292610

rasmusN-3

And where exactly do I make the changes to the URL? I can't find that

October 16, 2024 at 7:49 am #16293765

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

If the product is already translated and you need to change the URL of the translated product, then yes, you need to do this.

If this is not what you are asking, please elaborate a little more so I can better understand. Sometimes, screenshots illustrating what you mean may go a long way to clarify what words fail to convey. If you'd like, you can use the "upload an image" option below the comment area.

I have attached some screenshots.

Settings-‹-woosite-—-WordPress.png
Advanced-Translation-Editor-WPML.png
October 17, 2024 at 7:47 pm #16301896

rasmusN-3

It's not that I want to translate the URL, but the Swedish version doesnt hold the same structure. Please see attached photos. This is the same corresponding pages, one in the English version and one in the Swedish version. The Swedish version has "produkt-kategori" in it, but as you can see that is removed in the English version which is the default one.

Skärmavbild 2024-10-17 kl. 21.43.58.png
Skärmavbild 2024-10-17 kl. 21.44.13.png
October 18, 2024 at 6:20 pm #16306056

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

Thank you for the explanation. I understand it clearly now.

Do you use any plugins that can remove the category from the URL? What happens if you temporarily disable all plugins except WPML, WooCommerce, and WooCommerce Multilingual?

I have enabled debug information for this support ticket. Please follow this link for instructions on how to retrieve this information from your site and provide it to us: http://wpml.org/faq/provide-debug-information-faster-support/

October 18, 2024 at 9:19 pm #16306545

rasmusN-3

Hi,

Yes, I use Rankmath for this. If I disable it, the URL structure changes for the English version too.

Sorry I’m not by the computer now to send the debug data.

October 21, 2024 at 2:44 pm #16312951

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

Thank you for your feedback.

No worries about the debug information; it looks like a known issue. Please have a look here: https://wpml.org/errata/rank-math-seo-turning-on-strip-category-base-causes-issues-with-secondary-languages/

We’re working on a fix for this issue. In the meantime, do not translate the category, product or product-category slugs. The untranslated terms won’t be visible in the URL anyway when you use any those options.

October 21, 2024 at 8:39 pm #16314398

rasmusN-3

Hi, I dont understand the workaround. The workaround is to NOT translate the slugs and have the slugs in the Swedish version in English??

October 22, 2024 at 7:53 am #16315467

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

Yes, that is correct. You can also try the following steps:

1. Go to WPML → String Translation and delete the product-category slug from the table.
2. Then, re-save permalinks in Settings → Permalinks.

If this is still the problem, put the English product-category slug into Swedish translation.

Please backup your database before making any changes.

October 22, 2024 at 7:59 am #16315484

rasmusN-3

Hi,

This can not be considered an work around as the result is not the same. Of course the URL should not be in English for a Swedish site.

What you are recommending is not good for SEO, I can see this has been an issue for several years so why don’t you fix this?!

October 22, 2024 at 8:08 am #16315580

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

Thank you for your feedback.

This should exclude the product-category slug from the secondary language. As a result, the link becomes hidden link, which will match the structure of the original hidden link. Do you think it will affect your site's SEO if the English part of the URL is excluded?

October 22, 2024 at 8:19 am #16315624

rasmusN-3

Hi,

Then I am confused on how to achieve this. Can you login and do it?

October 22, 2024 at 10:54 am #16316771

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

If possible, I need to request temporary access (wp-admin and FTP) to your site where the problem has been replicated to be of better help. When you log in to leave your next reply, you will find the needed fields below the comment area. The information you will enter is private, meaning only you and I can see and access it.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.