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.

Our next available supporter will start replying to tickets in about 6.25 hours from now. Thank you for your understanding.

This topic contains 5 replies, has 2 voices.

Last updated by Mohamed Sayed 1 year, 3 months ago.

Assisted by: Mohamed Sayed.

Author Posts
August 1, 2023 at 10:24 am #14132807

arnoP-3

Hi,

I am trying to remove a text from a translation, but I can't.

1. I have a custom field (created with Meta Box) with text. The text was translated. That's all fine.
2. I removed all text from the field in English.
3. But, the translated text stays on the German page. I cleared the caches, I made a change to the English page and the translation. Nothing helps so far.

Shouldn't WPML remove the translation automatically if the original value was removed? Or at least give me the option to do so in the Advanced Translation Editor?

Thanks,
Arno

August 1, 2023 at 7:36 pm #14137377

Mohamed Sayed

Hi Arno,
Thanks for contacting WPML support.

WPML will update the translation automatically only if the "Translate Everything Automatically" mode is enabled and the translation was created with the same mode.

Please go to WPML > Settings > Custom fields translation, and search for the field then let me know which option is set for this field.

Kind regards,
Mohamed

Settings ‹ Sandbox — WordPress - Google Chrome 202.png
August 2, 2023 at 12:08 pm #14142053

arnoP-3

Hi Mohamed,

The field is set to Translate, but we don't use "Translate Everything Automatically". We translate manually in the ATE, with the help of Deepl.

So, in this case, if we cleared the text in English, how do we remove it from German?

Thank you,
Arno

August 2, 2023 at 3:15 pm #14143617

Mohamed Sayed

Hi,

I tested this on a clean installation and I can see the same behavior. When the field value is removed from the default language, it's not displayed in the advanced translation editor but the translated value is not removed from the secondary language.

I think this is expected because when the custom field is set to "Translate", it means that the field value won't be kept in sync across different languages.

So you can remove the translated value manually with the following steps:

1. Edit the post in the default language
2. Switch to the second language from the top admin bar
3. In the popup, click "Edit Anyway"
4. Remove the text and update the page

Please check this recording hidden link

Let me know please if that helps.

Kind regards,
Mohamed

August 3, 2023 at 5:13 am #14145563

arnoP-3

Hi Mohamed,

Thanks a lot, that worked for me.

It does feel a bit like a hack, I'd expect the ATE to have an option for this. But if you say this is a safe way to solve this, I'm fine.

Kind regards,
Arno

August 3, 2023 at 11:47 am #14149151

Mohamed Sayed

Hi Arno,

I'm glad to hear that it works. Please note that removing the value manually shouldn't affect your translations.

I also checked with our developers about this behavior and they confirmed that this is expected.

We filter out the blank strings and they are not sent to ATE. Thus the previous translation is not replaced and the translated field value remains in the second language.

Another workaround that can help in your case, is to add a Non-breaking Space instead of keeping the original field blank hidden link

 

Then you can update the translation using WPML's advanced translation editor and it will replace the translated value with the non-breaking space.

You can also try the following filter but it works only if the meta key and value were removed, which means that the field is deleted totally not only the value.

add_filter('wpml_sync_deleted_custom_fields', '__return_true');

Kind regards.

August 3, 2023 at 12:43 pm #14149547

arnoP-3

Thanks Mohamed.