Skip Navigation

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
10:00 – 14:00 10:00 – 14:00 10:00 – 14:00 10:00 – 14:00 10:00 – 14:00 - -
16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 - -

Supporter timezone: Asia/Jerusalem (GMT+03:00)

Tagged: 

This topic contains 8 replies, has 0 voices.

Last updated by Itamar 6 days, 17 hours ago.

Assisted by: Itamar.

Author Posts
June 23, 2025 at 11:49 am #17159763

antonioN-6

Background of the issue:
I am trying to use the 'Rewrite-Republish' feature of the Yoast Duplicate Post plugin on a translated page that was independently translated using the WPML plugin. I expected the draft to maintain the translated language of the original page. Link to a page where the issue can be seen: hidden link. More details can be found at hidden link and https://wpml.org/plugin/yoast-duplicate-post/. Environment: WordPress version 6.8.1, theme: twenty-five version 1.2, plugins: sitepress-multilingual-cms version 4.7.6, duplicate-post version 4.5.

Symptoms:
When I initiate a 'Rewrite-Republish' from a translated page, it creates a draft in the default language of the website instead of the translated language. This behavior is inconsistent and can lead to overwriting the correct translated page with the default language content, altering URLs, and potentially losing important settings associated with the translated page/post.

Questions:
How can I ensure that the 'Rewrite-Republish' feature maintains the translated language of the original page?
Is there a way to fix the language issue when creating a draft using the 'Rewrite-Republish' feature?

June 24, 2025 at 8:31 pm #17166820

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

We need to replicate this issue on a fresh WordPress installation. Then I'll be able to escalate it to our compatibility team. To achieve this, I created a test website with a clean WordPress installation. You can access it through this link:

hidden link

With this link, you'll be directly logged in.

Could you please install the Yoast Duplicate Post plugin and see if the issue is replicable on a clean WordPress installation?
Please configure WPML as it is set on your site (just the basic configurations needed to replicate the issue are sufficient).

Please also make sure that you are installing the latest version of the plugin.

When everything is finished and you can replicate the problem, please let us know.

Important! Do not import your site to the test site. We must replicate the problem on a fresh, clean WordPress installation.

Regards,
Itamar.

June 25, 2025 at 8:22 am #17167588

antonioN-6

Hi, thank you so much for your reply!
We reproduced the issue in the sandbox site.
As you can see in the sandbox, there is a test page published in primary and secondary language (classic translation editor) but the 'rewrite republish draft' of the secondary language is in the primary language.

We can produce more information or tests, if you need it.

In order to investigate the issue we noticed that sometimes it can't be reproduced.
It could be somehow related to actions done by the user, before the click on the 'rewrite republish' button.
Maybe it's related to the cookies? i.e. wp_lang? In fact, sometimes this cookie is unset.

We notice that in some part of the YOAST Duplicate post plugin, the author took care of WPML integration (i.e. file /duplicate-post/compat/wpml-functions.php)
And we notice that WPML plugin puts a lot of effort into ensuring compatibility with other great plugins.

We are not sure if the issue can be fixed in the duplicate-post plugin or in the WPML plugin? or with a work by both sides.

We opened the issue into the Yoast post-duplicate forum too.
https://wordpress.org/support/topic/incorrect-wpml-language-in-rewrite-republish-yoast-duplicate-plugin/

Thank You

June 25, 2025 at 12:40 pm #17169248

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

Thanks for reproducing the problem on the sandbox site. However, I was unable to replicate it on the sandbox site. When escalating an issue to our second-tier support team, I must provide them with the steps to reproduce the issue. I know you said it does not happen every time. But I tried it in many ways. Here is one way I tried:

1. I created the page in English.
2. I translated it into Italian with the WordPress editor.
3. I clicked the Rewrite and Republish option. Please see the attached screenshot.
4. I noticed it was ok and no new page was created in English.

I also tried by first creating the page in Italian and translating it into English. And also when the page was duplicated (WPML duplicate option) into another language.

Could you please specify the steps to reproduce the problem?

It would be great if you could share a video with me of the problem. You can use the free online screencast service Komodo - hidden link.

Regards,
Itamar.

2025-06-25_15-23-37.jpg
June 26, 2025 at 9:46 am #17172588

antonioN-6

Thank you for your patience and for your instructions!
I think I went deeper into the issue, with the next informations:
as you can see by the 4 recording, the issue is reproducible in, at least, 4 cases, but we can find more, because it's related to the session cookies, and the session cookies can be changed in a lot of cases):

(I recorded and uploaded 4 screen records in a drive folder, but if you need it, i can use external services like komodo, let me know it)

link to the drive folder of the record:
hidden link

- wpml-rewrite-issue-1 :
hidden link
If the user interact with other pages of the website (i.e. with other tabs) he could change the cookies (wp-wpml_current_admin_language and wp-wpml_current_language) and so the button 'rewrite republish' in the 'edit page' will create a draft in the wrong language (with possibly disruptive effects like wrong parent, url change, overwriting of content in the wrong language, and so on.)

- wpml-rewrite-issue-2 : as in recorded case 1, but with opposite languages.
hidden link
If the user interact with other tabs in the secondary language (italian), changing the session cookies, and he click on the previously opened edit page in english, the rewrite republish that should be in the primary (english) language will be created in the wrong (secondary/italian) language.

- wpml-rewrite-issue-3 :
hidden link
if the user is viewing the list page selecting the 'all language' filter,
the wp-wpml_current_admin_language cookie is set to 'all' and with the click in the 'rewrite republish' button from the list page he will create a draft in the wrong language.

Monitoring the cookies we can find easily other cases, for instance
- wpml-rewrite-issue-4 : if the user login and goes directly to the edit page
hidden link
if the user login and goes directly to the edit page link (without the lang= parameter in the url), the page language is ignored, the default language is used for the new draft of the rewrite republish button.

June 26, 2025 at 6:47 pm #17175010

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

I requested access to the GD folders. Please approve.

Thanks,
Itamar.

June 26, 2025 at 6:52 pm #17175018

antonioN-6

Hi,
My apologies for the GD blocked access.
I’ve now granted access to the files.
Thanks.

June 29, 2025 at 7:29 pm #17180835

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

You only opened the GD for wpml-rewrite-issue-3. However, I was able to replicate the issue with this scenario. I'll esclate this to our second-tier supporters and keep you updated here.

I appreciate your patience.
Itamar.

June 30, 2025 at 2:34 pm #17185064

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

This issue is now escalated to our compatibility team. We'll keep you updated on any news regarding this issue.

I appreciate your patience.
Itamar.