Skip Navigation

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

Problem:
1. When copying a blog post to another language, the language prefix (e.g., -tr) is added to the category name in the URL.
2. When copying a page or custom taxonomy to a new locale, the name in the URL is translated, which is not desired.

Solution:
For the first issue, currently, there is no automated solution. The behavior of adding a language prefix to the category name when copying a post to a new language is a default WordPress behavior, and it must be edited manually.

For the second issue, to prevent the URL from being translated when copying a page or custom taxonomy:
1. Navigate to WPML -> Settings -> Translated documents options -> Page URL.
2. Choose the option 'Translate (this will include the slug in the translation and not create it automatically from the title)'.
3. Click the Save button.
After this change, when using WPML's Translation Editor to translate a page, you will have the option to translate the slug. Instead of translating it, simply copy the original value to the translation side.

Relevant documentationhttps://wpml.org/documentation/getting-started-guide/translating-page-slugs/#sending-post-or-page-slugs-to-translators
https://wpml.org/errata/translated-term-slug-identical-to-the-original-term-slug/

If this solution doesn't look relevant, please open a new support ticket.

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 3 replies, has 2 voices.

Last updated by Itamar 1 year, 6 months ago.

Assisted by: Itamar.

Author Posts
September 20, 2023 at 3:15 pm #14431639

pavels-39

Good afternoon!

I'm having a few problems with the WPML plugin.

1. The thing is that when on the blog post page I want to copy this post to another locale, for example Turkish from the English locale, to then translate this post for the Turkish locale, the prefix -tr is added to the category name.

hidden link
and it should be
hidden link

How can I cancel this behavior so that when I copy a post or page to a new language locale, the language prefix is not added!?

2. When copying a page or custom taxonomy page to a new locale the name in the url is translated, example:

hidden link
and the url should be like this
hidden link

How to cancel this behavior!?!?

September 21, 2023 at 8:52 am #14435985

Itamar
Supporter

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

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

Hi.

1. What you refer to as "category name" is also called "category term". I can see that on your site, you solved this issue. When I go to hidden link, I get hidden link. The term slug is without -tr.

Can you please confirm that you have found the workaround for this?

I'll further explain about this problem now. The problem stems from WordPress itself and not from WPML. WordPress API does not allow to have more than one occurrence of a slug for a specific taxonomy. We explain this problem and provide a workaround in the following link.

https://wpml.org/errata/translated-term-slug-identical-to-the-original-term-slug/

2. Also, in this case, I can see that the problem is solved. When I go to hidden link, I get the slug in English, not Turkish. hidden link.

Did you manage with this as well?

We explain about translating pages and posts slug at the following link.

https://wpml.org/documentation/getting-started-guide/translating-page-slugs/#sending-post-or-page-slugs-to-translators

Regards,
Itamar.

September 21, 2023 at 9:21 am #14436531

pavels-39

Unfortunately I didn't solve the problem myself, I had to manually change the urls in both problems, that's why you saw as if I solved the problem.

But I didn't.

I have studied these few articles that you suggested me to solve the problem. And on the first problem it turns out that WP is to blame? Not WPML?

And it turns out the solution is only to manually edit these urls, if the slug -tr and other language slugs are added?

But this is not practical, especially if I have a lot of languages on the site, I will have to edit the names of categories every time, removing these prefixes.

I don't quite understand about the second question either. I do not need to make the url translated, and you gave an article where it says how to make the url translated!
I need the opposite!

September 21, 2023 at 3:26 pm #14440813

Itamar
Supporter

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

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

You wrote: "And it turns out the solution is only to manually edit these urls, if the slug -tr and other language slugs are added?"

I understand how inconvenient it is. But I'm sorry, currently, there is no other option. As I mentioned, the problem is coming from WordPress.

You also wrote: "I don't quite understand about the second question either. I do not need to make the url translated, and you gave an article where it says how to make the url translated!
I need the opposite!"

I'm sorry if I was not clear enough.

By default, the 'Auto-generate from title' is selected; you don't want this option. Therefore, please follow these steps.

1. Go to WPML -> Settings -> Translated documents options -> Page URL.

2. Select the 'Translate (this will include the slug in the translation and not create it automatically from the title)' option.

3. Press the Save button.

Now, when you translate a page with WPML's Translation Editor, you will see the option to translate the slug of the page. So, in your case, you don't need to translate it from English to Turkish. You only need to copy the original value. Let's take, for example, your Company Goals page. After changing this option, you will see a 'URL' field in WPML's Translation Editor. The original value of the URL field will be 'company-goals'. What you need to do is to copy this to the translation side. Please see the attached screenshot.

copy-url-slug.jpg