Skip to content Skip to sidebar

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.

Sun Mon Tue Wed Thu Fri Sat
- - 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00
- - - - - - -

Supporter timezone: America/Lima (GMT-05:00)

This topic contains 3 replies, has 0 voices.

Last updated by Andreas W. 3 weeks, 4 days ago.

Assisted by: Andreas W..

Author Posts
March 17, 2026 at 7:05 pm #17905822

Vincent Dagenais

Hi,

We have a woocommerce site.

How do I keep dates, post status in sync for all languages.

March 19, 2026 at 2:13 am #17909623

Andreas W.
WPML Supporter since 12/2018

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

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

Hello,

At WPML > Settings > Posts and pages synchronization you can enable:

- Copy publishing date to translations

When it comes to these options, WPML will always sync from original content to translated content, not the other way around.

About the Post status:
WPML doesn’t sync this field. If you publish the original, translations remain in their current status (often “draft” or “needs update”). This behavior is expected like this when it comes to most WPML users.

There is a hook in WordPress that fires each time a post status changes.
https://developer.wordpress.org/reference/hooks/transition_post_status/

You could build a custom logic that would automatically also set the status for translations by combining this hook with WPML Hooks.

Example:

/**
 * Synchronize post status across all WPML translations.
 */
add_action('transition_post_status', 'sync_translation_status', 10, 3);

function sync_translation_status($new_status, $old_status, $post) {
    // 1. Prevent infinite loops and only run if status actually changed
    if ($new_status === $old_status || (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)) {
        return;
    }

    // 2. Check if WPML is active
    if (!did_action('wpml_loaded')) {
        return;
    }

    // 3. Get the element type (post, page, or custom post type)
    $post_type = get_post_type($post->ID);
    $element_type = 'post_' . $post_type;

    // 4. Get the "Translation Group ID" (trid) for this post
    $trid = apply_filters('wpml_element_trid', null, $post->ID, $element_type);

    if ($trid) {
        // 5. Get all translations for this trid
        $translations = apply_filters('wpml_get_element_translations', null, $trid, $element_type);

        if (!empty($translations)) {
            // Temporarily unhook to prevent recursion
            remove_action('transition_post_status', 'sync_translation_status', 10);

            foreach ($translations as $translation) {
                // Skip the post we just updated to avoid redundant DB calls
                if ($translation->element_id == $post->ID) {
                    continue;
                }

                // 6. Update the translation status
                wp_update_post(array(
                    'ID'          => $translation->element_id,
                    'post_status' => $new_status,
                ));
            }

            // Re-hook for future operations in the same request
            add_action('transition_post_status', 'sync_translation_status', 10, 3);
        }
    }
}

Note that these custom hooks would work for original content or translations. Even if you change the status of a translated post, it will update the status of the original post and all its translations.

You can save this snippet at the end of the functions.php file of a Child Theme or use it inside a Code Snippet plugin.

Best regards
Andreas

March 19, 2026 at 7:01 pm #17912312

Vincent Dagenais

Hi Andreas,

Thank you for the information about the wpml setting and the code snippet.

I have selected the At WPML > Settings > Posts and pages synchronization you can enable:

- Copy publishing date to translations.

That works !!

Concerning the post status that do not sync, I understand , but still it would be good to have this as a setting.

Let say you have 3 languages, and a ecommerce site. Your product becomes closed (custom post status). Then you have to go into each language set individually each post. Which is a lot of work. Imagine now you a lot of products that you need to change post status to closed.

Personnally, I think this should be a good setting / option to have.

March 19, 2026 at 7:54 pm #17912362

Andreas W.
WPML Supporter since 12/2018

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

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

I completely agree on that!

Allow me to consult our product manager on this matter, and I will get back to you once I receive his feedback.