How to disable the “Synchronise repeater and flexible sub-fields positions in post translations” WPML ACF option

Categories
Web Development

The Problem

If you use WordPress and have WPML with their Advanced Custom Fields Multilingual (ACFML) plugin installed you may have already spotted the following option below repeater fields:

Option to synchronise repeater and flexible sub-fields positions in post translations
(record drag-and-drop moves and do the same moves in other translations).

While this may seem like a nice option it’s turned on by default and not great for websites that use a repeater as the main content field and have pages with varying content for different languages. I often use the Flynt theme for developing custom-made WordPress sites, which uses the given setup.

The solution: disable the “Synchronise translations” option by default

Sadly I haven’t found a documented way to disable the option. While looking through the ACFML plugin however I’ve found the following solution in two easy steps:

1. Add the following lines to your wp-config.php file:

/* Disable ACFML's sync of repeater field positions across languages by default */
define( 'ACFML_REPEATER_SYNC_DEFAULT', false );

2. Most likely: update setting of existing posts

In your database select the “wp_options” table and look for a record with “option_name” = acfml_synchronise_repeater_fields. This record seems to contain the post IDs of existing posts with their corresponding boolean setting.

Rename the acfml_synchronise_repeater_fields column to something like acfml_synchronise_repeater_fields_backup in order to disable/unset the value for all existing posts. As soon as you set the setting for a post again this record will be recreated.

Feedback appreciated

If this solution helped solve the same problem for you it would be great if you could let me know that in the comments below.

4 Kommentare

  1. Thank you! This solved the issue we were having with ACF. Without this fix, when adding a new flexible content section, it messed with other translations.

  2. Thank you for this!

    It is unbelievable how horrible this is documented by WPML.

    Several of my clients had issues with WPML and ACF repeater fields messing up the entire content of pages which resulted in a shit load of work to investigate. I almost lost my mind.

    Finally found what was causing the issue. Described it here:
    https://wpml.org/forums/topic/acfml-→-synchronizing-repeater-between-languages-mixes-up-subfield-content/

    The answer as not helpful, the topic was closed.

    I finally found the constant in the plugin files and googled it. There were exactly 2 entries: one post in the WPML support forum and this one.

    Really sad bc I think that implementing this syncing feature step by step was affecting a bunch of sites using this setup.

    So anyways, thanks for sharing your findings and helping others solving this issue!

    • Hey Christoph

      Glad it helped!
      Yes, I also only found this while looking through the source code of the WPML itself – very sad!

      In general it looks to me like WPML has changed how their support system works: only a few months ago new support issues could be published publicly after being resolved (if I remember correctly), therefor establishing a valuable collection of solutions for WPML problems…but today it will not be published anymore and makes troubleshooting harder. I am also getting more and more traffic on this blog post.

Dein Kommentar

Hinweis: Deine E-Mailadresse wird nicht veröffentlicht.

This site uses Akismet to reduce spam. Learn how your comment data is processed.