Background of the issue:
I have a custom taxonomy on my site under development that I set to not be translatable. I am trying to manage translations for this taxonomy.
Symptoms:
Translations have been added for all of the terms in the custom taxonomy, even though it is set as not translatable.
Questions:
Why are translations being added to a taxonomy set as not translatable?
How can I prevent WPML from translating this custom taxonomy?
I have one CPT with two taxonomies (Filters and Countries).
One taxonomy was set as translatable (Filters) and the second (Countries) was set as not translatable.
We decided that also the one that was set as translatable didn't need to be translatable so we changed it to not translatable but after this change the Countries end up having duplicated terms one for each translation!
Why the change to one taxonomy affected the other?
Also is there a way to remove all those duplicated now from Country taxonomy?
To assist you more effectively, could you please provide a detailed explanation of the issue you are facing? In some cases, screenshots can help clarify any confusion or miscommunication. If you wish to share a screenshot, please use the "upload an image" feature located below the comment section.
Although this topic is related to the other, it is a bit different.
It is strange because the taxonomy that was set as non-translatable when Save was clicked in the WPML settings (Taxonomies section) WPML created translated terms!
The strange part is that the created terms had also assigned posts.
Just to be sure, I deleted all the terms, created my own terms and then tried to change the option of the other taxonomy from translatable to non-translatable and again added translated terms to Countries taxonomy which is from the start as non-translatable.
Can you think of any reasons for this?
Another taxonomy affecting another?
Or the save button is just updating all the taxonomies settings and there is a bug?
I'm not entirely sure why this issue is occurring. Could you please try to replicate it on a fresh installation? I have created a staging site for you, and I will provide the link in a private reply.
Additionally, I want to point out that if you expect the taxonomy to remain in sync with the translated posts, there is no reason to set the taxonomy as non-translatable, so this might not be relevant for further testing.
I clicked a few buttons in my installation in troubleshooting page and after this I cant replicate the issue again.
I think I clicked "Clear WPML cache" "Set language information" and "Fix count".
So seems to be fixed now.
The taxonomy is a list of all the countries and the slug of each term is the country code. Like: "GR", "DE", etc
Because I need the slug to be specific if I make it translatable then I believe the terms slug will be GR-DE GR-ES, etc.
Am I correct?
And this will affect how my geolocation functionality works with this taxonomy.
Because I want the terms to be synced between translations (and English post to be the source of truth) is it a good idea to create a function on post save that will get the english selected terms and set them to all the translations of the post?
Do you think will affect any WPML base functionality or is there any better workaround keeping terms synced between translations?
The taxonomy is a list of all the countries and the slug of each term is the country code. Like: "GR", "DE", etc
Because I need the slug to be specific if I make it translatable then I believe the terms slug will be GR-DE GR-ES, etc.
By default, WordPress does not allow the same slug for taxonomy terms. However, WPML can manage this. When you translate your taxonomy term, you can edit it further by removing the language prefix. For example, you can change "GR-DE" to "GR." I have attached a screenshot for your reference.
Because I want the terms to be synced between translations (and English post to be the source of truth) is it a good idea to create a function on post save that will get the english selected terms and set them to all the translations of the post?
I believe this is how it works now, no? Specifically, when you edit the terms as I described above to match the original term's slug.
"By default, WordPress does not allow the same slug for taxonomy terms. However, WPML can manage this. When you translate your taxonomy term, you can edit it further by removing the language prefix. For example, you can change "GR-DE" to "GR." I have attached a screenshot for your reference."
As I can understand this needs to be done manually.
So I'll need to manage the taxonomy terms (250 terms in total) + the translations for 4 languages.
This is why I set it to not translatable in the first place.
The issue is this ticket was the bug WPML creating different terms for an non-translatable taxonomy but seems to be fixed now.
"I believe this is how it works now, no? Specifically, when you edit the terms as I described above to match the original term's slug."
No, initially I thought that non-translatable taxonomies meant that the taxonomy terms will be copied from the original post. Now that I understand that this is not the case I'm thinking of building this synchronization functionality myself.
I just asked from your experience if this a common scenario or if this something I should avoid for some reason. (If for example there is a case in which WPML doesn't like posts from different languages to have the same terms assigned)
Thanks again for your support, appreciate it.
(This client has a site with many thousand posts/pages/reviews and he wanted to switch from WPML due to these issues he had and we are trying to find solutions to continue using WPML.)