Support » Plugin: Polylang » Conflict: Custom Field Template – CF data erased when new translations are added

  • Resolved AM


    First of all, thanks for this great plugin!

    I’m running the most current version of each:

    I just started using Polylang yesterday and love it. However, when I add a new translation for a post, it erases the data previously populated and saved to the original post using the Custom Field Template.

    In order for it to work with CFT, I have to:

    1. Type and save English post
    2. Add and save additional translations (e.g. German and French)
    3. Go back to English post to populate custom field template and save again.

    If I populate the custom field template prior to adding new translations, the date is erased (even after saving).

    If I need to add a fourth translation (Dutch) a little later, the custom fields values are once again erased and have to be repopulated after adding the 4th translation.

    It seems to work OK with Custom Field Template deactivated. I can add posts later without erasing the original custom fields values, so it must be something like the former issue some had with the Advanced Custom Fields plugin.

    I use a lot of custom fields on my sites so the Custom Field Template saves me a lot of time. It would be great if both these great plugins could work together.

    Thank you again for the nice plugin.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Chouby


    If you don’t need to synchronize your custom fields between translations, go to Polylang settings and de-activate the synchronization for custom fields. Hopefully it should solve the issue.

    If you need to synchronize the custom fields, then try this:
    edit polylang/include/admin-filters.php and modify the line 59 from
    add_action('save_post', array(&$this, 'save_post'), 10, 2);
    add_action('save_post', array(&$this, 'save_post'), 200, 2);

    Hi Chouby, thanks for the response. I do need to synchronize the custom fields, so I tried the change on line 59. Unfortunately, it did not work.

    I tested it by adding a new translation to an existing post and the custom fields were still erased.

    Thanks again.

    Plugin Author Chouby


    That’s not easy… Diving into the code of Custom field template, I discovered that the plugin does not rely on the existence of the custom fields to decide to populate the values in the form. So for a new post (new translation), it populates the default values even if Polylang does its job correctly and copies the custom fields into the translated post.

    I tried something… Please test the development version and tell me if it works as you expect.

    Sorry for the slight delay; I’ve been under the weather.

    I’ve just tested the development version and it works perfectly with Custom Field Template.

    Thank you very much for the great support and again for this brilliant plugin. I’ll be sure to give it a 5-star rating and make a donation as soon as I can.


    Matt Rad


    Hi Chouby,

    I have been having a similar problem. I thought I might let you know about it in case it helps you or any others with similar trouble. This thread and this one helped me solve my problem.

    We use a theme (Modernize) with custom fields used to structure our static homepage. When we updated Polylang to 1.0.1, the English language custom field content was overwritten with Japanese, even though the rest of the page structure remained in English. Repopulating the fields on the English homepage with English content overwrote the Japanese on the Japanese home. Previous versions of Polylang did not cause this issue.

    Unchecking “Custom fields” in Synchronization under Language Settings seems to have solved the problem.

    Plugin Author Chouby


    Yes. Previous versions of Polylang did not synchronize custom fields. This is a new feature which is appreciated by some people but can cause some issues with some themes or plugins. So the first thing to try in case of problem with custom fields is to uncheck the synchronization option in Polylang settings.

    Plugin Author Chouby


    I modified the compatibility code between Polylang and Custom field template to enable compatibility between Polylang and another plugin (The Event Calendar).

    I made some tests with the latest version of Custom field template (2.1.5) and it seems to work as expected.

    If you want to test the modified version before the next official release, you can test the development version (

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Conflict: Custom Field Template – CF data erased when new translations are added’ is closed to new replies.