Skip Navigation

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

Problem:
The client has a custom post type called Recipes. After duplicating and translating these posts using WP All Import, updating the original English Recipes also reverted the translations back to English. This issue likely arose because the posts were duplicated instead of being set to translate independently.
Solution:
To prevent this issue, it's recommended to set posts to be translated independently, so updates to the original language don't affect the translations. Unfortunately, there's no option to change all posts to 'translated independently' at once; this adjustment needs to be made in the database. You can use a tool like phpMyAdmin to access your database. In the

wp_postmeta

table, you should delete the key

_icl_lang_duplicate_of

for the duplicated posts. This action can be performed in bulk with the correct SQL query. However, directly modifying the database can be risky. Ensure you have a full backup before proceeding.

For more details on translating sites built with ACF, you can visit this link.

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 issues persist, 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 6 replies, has 2 voices.

Last updated by Andrey 12 months ago.

Assisted by: Andrey.

Author Posts
May 17, 2024 at 10:20 am #15638829

lukasb-36

Hello,
I have practical question. We have custom post type called Recipes. We duplicated all Recipes and then imported other language text with WP All Import, So far so good, everything was translated and okay. Recently I needed to update some of the original English Recipes by WP All Import and it changed the translation back to English too. I guess it is because we duplicated (as we were recommended during onboarding meeting) the posts instead of translate. What is the best practise here when we will time by time need to update posts in original language? How should we do it to avoid repeating the situation when after update of those posts we have other languages back in English?

Thank you in advance
Lukas

May 17, 2024 at 12:28 pm #15639621

Andrey
WPML Supporter since 06/2013

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

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

Thank you for reaching out to WPML support.

If you have duplicated posts earlier, they may have the duplicate status. You need to ensure they do not have this status before updating the original language post or importing translations.

There are two ways to address this:

1) Edit the duplicated post and select the "Translate independently" button. This will prevent the post from automatically syncing with the default language content. https://wpml.org/documentation/translating-your-contents/displaying-untranslated-content-on-pages-in-secondary-languages/#how-to-convert-a-translation-into-a-duplicate

2) Alternatively, you can delete an entry in the wp_postmeta database with the key _icl_lang_duplicate_of for the duplicated post.

I hope this information is helpful.

Screen Shot 2024-05-17 at 15.28.08.png
May 17, 2024 at 5:38 pm #15640629

lukasb-36

Hello Andrey,

thank you for your answer. Unfortunately I'm still not sure how to do it.

There are thousands of entries and we have taxonomies in ACF fields that should be same for all languages. It seems they are not copied to second language if it is translated independently. Is it right?
And is there way how to switch to "translated independently" all posts at once so we don't have to open one by one?

AS for 2) - Where and how can I delete it?

Thank you

Lukas

May 20, 2024 at 11:44 am #15645408

Andrey
WPML Supporter since 06/2013

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

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

Hello Lukas,

When translating independently, the post/page content is no longer copied from the original language, but the taxonomies should still be synchronized.

For more information, you can refer to this link: https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/. Unfortunately, there is no option to switch all posts to "translated independently" at once. This can only be done through the database.

Option 2) is for you or someone with knowledge of working with the database. You need to access your database using a tool like phpMyAdmin, and in the wp_postmeta database table, delete the key _icl_lang_duplicate_of for the duplicated posts. This can be done at once with the correct SQL query. If the entry _icl_lang_duplicate_of is deleted, the translated post is no longer in sync.

Please keep in mind that deleting something in the database is not recommended and is risky. You need to make sure to have a full backup before making any changes.

May 21, 2024 at 8:04 pm #15652620

lukasb-36

Hello Andrey,

I understand.
I have consequent question. I found out that those recipes have their _wpml_import_language_code changed to default language - meaning it was sk for (Slovak) and now it is en as default English. This happened with other custom post type too and I don't know why because that one was not imported. Few days ago I created new entries, duplicated them and exported with correct _wpml_import_language_code "sk". So it worked.
Also those taxonomies do not work properly. I imported taxonomies to default language but second language does not show them (when they should be seen on front end) as if they were empty.
Any idea why is that happening?

If we use Translate instead of Duplicate, would it automatically update taxonomies too if we update default language?
If I wanted to do the Recipes as Translate, do I have to delete all those duplicates first or can I use them and just change to translations (not independent one)?

May 22, 2024 at 11:16 am #15657586

Andrey
WPML Supporter since 06/2013

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

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

I cannot say for sure why this is happening, as it needs to be replicated and tested to understand the reason and the behavior itself.

You can find detailed instructions on how to create or import the taxonomies here: https://wpml.org/documentation/related-projects/wpml-all-import-plugin-website-import-with-wpml/importing-multiple-languages-with-wp-all-import-and-wpml/#step-2-create-your-taxonomies-in-wordpress

When you translate a post that has taxonomies, the translated taxonomy should automatically be assigned to the translated post, and it will stay synchronized. This means that if you change the taxonomy for the default language post, it should also change for the translated post.

I think both options are good. I suggest you test and see which one is better for you, whether to delete the duplicate or just change it to translations.

If you still have a problem with the subsequent question, I recommend you open a new support ticket. Provide detailed information and share a working example so the support team member can check it further.

May 29, 2024 at 10:50 am #15682982

Andrey
WPML Supporter since 06/2013

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

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

I want to share with you a workaround that might help you bulk disconnect duplicated posts: https://wpml.org/errata/inability-bulk-disconnect-duplicated-posts/. Please remember to back up your database before making any changes.