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?
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.
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
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.