Skip Navigation

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

Problem:
The client needs to programmatically set

wpml_synchronise_acf_fields_translations

to false for all existing and new posts and pages to prevent content on translated pages from being overwritten when the default language page is updated.
Solution:
We recommend overriding the default value of

ACFML_REPEATER_SYNC_DEFAULT

in your theme’s functions.php file by adding the following code:

define('ACFML_REPEATER_SYNC_DEFAULT', false);

For more details, please refer to our documentation on ACF Multilingual constants and hooks: ACF Multilingual Constants and Hooks Reference.

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. Should you need further assistance, please do not hesitate to open a new support ticket at WPML Support Forum.

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 0 voices.

Last updated by danM-2 4 days, 17 hours ago.

Assisted by: Andreas W..

Author Posts
June 27, 2025 at 10:39 am #17177041

danM-2

Background of the issue:
We would like to programmatically set wpml_synchronise_acf_fields_translations to false for all existing and new posts and pages on the site hidden link. This is to prevent the content on translated pages from being overwritten when the page in the default language is updated. We are experienced developers and are comfortable adding custom code.

Symptoms:
When wpml_synchronise_acf_fields_translations is set, updating the page in the default language causes the content on translated pages to be overwritten.

Questions:
Is there a hook we can use to ensure that wpml_synchronise_acf_fields_translations is always set to false, preventing default language content from syncing to translated pages?

June 28, 2025 at 8:15 am #17179026

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Do I understand correctly that your translated content is getting overwritten with original content if you edit and save the original content?

This was a known issue in WPML 4.7.3.

Please update WPML to version 4.7.6 and also update any active add-ons.

You can find the updates at Plugins > Add new on the Commercial tab by clicking on "Check for updates".

Best regards
Andreas

July 1, 2025 at 11:55 am #17188326

danM-2

Hi,

"Do I understand correctly that your translated content is getting overwritten with original content if you edit and save the original content?"

Yes that is correct and we will try updating the plugin.

However we would still like to programmatically set wpml_synchronise_acf_fields_translations to false for all existing and new posts and pages on the site.

Is there a hook we can use to do that?

Thanks,

Dan.

July 1, 2025 at 12:13 pm #17188472

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

The hooks that WPML's developer docs suggest can be found here:
https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/

You will find the following hooks, including examples:

- wpml_sync_custom_field:
https://wpml.org/wpml-hook/wpml_sync_custom_field/
and
- wpml_sync_all_custom_fields
https://wpml.org/wpml-hook/wpml_sync_all_custom_fields/

These hooks will only fire if the field(s) are set to "Copy".

I can sadly not suggest any further hooks, as I can not guarantee if changing them could cause any unexpected side-effects or harm your site.

Further, our support is not responsible for providing custom code solutions, but you can try to reach out to a contractor who might be able to assist you with this matter.

More details:
https://wpml.org/purchase/support-policy/

July 1, 2025 at 1:08 pm #17188656

danM-2

Hi,

In case there is any confusion, we are NOT looking to sync our custom fields from default language to translations.

We are looking to set the value of a WPML field that appears on default language posts and pages (see screenshot): wpml_synchronise_acf_fields_translations

Rather than have this controlled by the checkbox in the UI, we'd like to programmatically set it to false for all posts and pages.

How can we achieve that?

Thanks,

Dan.

2025-06-25_12h03_38.png
July 1, 2025 at 1:24 pm #17188704

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Thank you for the clarification, and my apologies for the misunderstanding!

This field should usually be enabled by default.

You can override the default value of ACFML_REPEATER_SYNC_DEFAULT in your theme’s functions.php file:

define('ACFML_REPEATER_SYNC_DEFAULT', false);

Source:
https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/acf-multilingual-acfml-constants-and-hooks-reference/#acfml_repeater_sync_default

July 1, 2025 at 2:05 pm #17188925

danM-2

Thanks that seems like exactly what we need!

Dan.