Skip to content Skip to sidebar

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

Problem:
If you're experiencing issues where a post translated from French to English and scheduled for later publication reverts to the original French category upon publication, we have identified a solution.
Solution:
We recommend modifying a specific file within the WPML plugin. Please follow these steps:
1. Navigate to

/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/Shutdown/Hooks.php

.
2. Replace the existing

translateMedias()

function with the following code:

public function translateMedias() {<br />    if (!wp_doing_cron()) {<br />        foreach ( $this->pbIntegration->get_save_post_queue() as $post ) {<br />            this->pbIntegration->translate_media( $post );<br />        }<br />    }<br />}

This adjustment ensures that media translations are not processed during scheduled tasks, which helps maintain the correct category associations for scheduled posts.

Please note that this solution might become outdated or may not apply to your specific situation. 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. If the issue persists, please open a new support ticket.

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.

Tagged: 

This topic contains 23 replies, has 0 voices.

Last updated by Olivier 3 months ago.

Assisted by: Shekhar Bhandari.

Author Posts
January 23, 2026 at 9:33 am #17756453

Olivier

Hello,

I will make the zip file on next monday or tuesday.

Regards

January 26, 2026 at 3:59 am #17760828

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Sure

January 27, 2026 at 7:39 am #17765216

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello,

I tried downloading the files multiple times, but it’s taking too long and keeps crashing. Please upload the files using a file-sharing platform such as Google Drive to avoid this issue.

When uploading the wp-content ZIP folder, you can exclude the wp-uploads folder to reduce the overall size.

Private reply has been enabled.

Thanks.

January 27, 2026 at 9:27 am #17765974

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Thank you for the info.

I have forwarded the issue to our 2nd tier supporters.

Thanks

January 28, 2026 at 5:55 am #17769344

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Our 2nd tier checked the issue and suggested the following workaround, can you please try this and see if it helps:

- Go to /wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/Shutdown/Hooks.php

- Replace the following code

public function translateMedias() {
		foreach( $this->pbIntegration->get_save_post_queue() as $post ) {
			$this->pbIntegration->translate_media( $post );
		}
	}

with

public function translateMedias() {
		if (!wp_doing_cron()) {
			foreach ( $this->pbIntegration->get_save_post_queue() as $post ) {
				$this->pbIntegration->translate_media( $post );
			}
		}
	}

Let me know if this helps.

Thanks

January 28, 2026 at 2:37 pm #17770862

Olivier

Hello,

thanks, it seems to resolve the issue.

Do you plan to add this code to the next version of WPML ?

Regards,

January 29, 2026 at 4:36 am #17772139

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Yes, the fix will be included in the next release.

Thanks

January 29, 2026 at 8:43 am #17772733

Olivier

Hello,

we'll make a last test in production tomorrow.

I'll tell you if it's OK.

Best regards,

January 30, 2026 at 9:47 am #17776581

Olivier

Hello,

the issue is resolved.

Thanks a lot !