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.

Tagged: 

This topic contains 6 replies, has 1 voice.

Last updated by Otto 1 year ago.

Assisted by: Otto.

Author Posts
April 9, 2025 at 2:01 pm #16914222

mobintegL

Background of the issue:
I am trying to update the translated pages by editing their content, specifically by adding text and blurbs. The original pages are in Portuguese, and the translations are in English. The issue can be seen on this page: hidden link. The website is built with the Divi theme, running WordPress version 6.7.2 and PHP version 7.4.16. Translations have always been handled by duplicating the original (Portuguese) page and manually replacing the content with the English version. This process has worked without issue until now. We have tried updating Divi and WPML to their latest versions and reinstalled WordPress. Despite these efforts, the issue persists. In addition, we’ve identified the following errors in the debug.log: [02-Apr-2025 15:29:02 UTC] WordPress database error Duplicate entry '27929-pt-pt' for key 'trid_lang' for query INSERT INTO `wp_icl_translations` (`element_type`, `language_code`, `trid`, `element_id`) VALUES ('post_attachment', 'pt-pt', '27929', '165009') made by require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, MTNC->mtnc_set_global_options, mtnc_get_plugin_options, mtnc_get_default_array, mtnc_insert_attach_sample_files, wp_insert_attachment, wp_insert_post, do_action('add_attachment'), WP_Hook->do_action, WP_Hook->apply_filters, WPML_Media_Attachments_Duplication->save_attachment_actions, SitePress->set_element_language_details, WPML_Set_Language->set, WPML_Set_Language->insert_new_row [02-Apr-2025 15:40:18 UTC] WordPress database error BLOB, TEXT, GEOMETRY or JSON column 'slug' can't have a default value for query ALTER TABLE wp_realmedialibrary ALTER COLUMN `slug` SET DEFAULT '' made by activate_plugins, activate_plugin, do_action('activate_real-media-library/index.php'), WP_Hook->do_action, WP_Hook->apply_filters, MatthiasWebRealMediaLibraryActivator->install, MatthiasWebRealMediaLibraryActivator->dbDelta, dbDelta

Symptoms:
The translated pages are being overwritten with content from the original pages. Even when I attempt to manually update the English page by replacing the Portuguese text with the correct English content, the changes are not saved. The debug.log shows WordPress database errors related to duplicate entries and default values for columns.

Questions:
What might be causing the translated pages to be overwritten with content from the original pages?
How can I resolve the issue of changes not being saved on the English pages?

April 10, 2025 at 7:28 am #16916888

Bigul

Hello,

Welcome to the WPML support forum. Before passing this thread to my colleague, I would like to share some suggestions and possible solutions for the issues you mentioned.

It looks like this may be related to the following known issue:
https://wpml.org/errata/wordpress-database-error-duplicate-entry/

So please run the following query after a full site backup using a tool like PHPMyAdmin. Delete the duplicate entries from the query results.

SELECT * FROM wp_icl_translations WHERE trid = 27929 AND language_code = 'pt-pt'

Refer to this similar ticket for more details: https://wpml.org/forums/topic/duplicate-entry-2028-en-for-key-trid_lang/page/2/#post-8232421

Please note that the same issue may occur with a different trid. In that case, change the query and run it again until the issue is resolved.

--
Thanks!

Bigul

April 10, 2025 at 11:13 am #16918023

mobintegL

Hi,

Thank you for your response. We followed your suggestion and ran the query, but we weren’t able to find any duplicate entries in the results. Could you please assist us further with this issue?

Thank you!

April 14, 2025 at 4:29 pm #16930517

Otto

Hello,

I apologize for the delay in responding. I will take care of this ticket; the reply time will be shorter now.

There are two issues here, right?

1. Translations revert to the original content
2. The database error

After Bigul's suggestion, does issue 2 persist?

Regarding the first issue. Please make sure that after duplicating the original content into the translation and modifying the content, you click on "Translate independently". If you don't, the content will revert each time you edit the original page:
https://wpml.org/documentation/translating-your-contents/displaying-untranslated-content-on-pages-in-secondary-languages/

Best Regards,
Otto

April 15, 2025 at 8:37 am #16932440

mobintegL

Hello Otto,

Thank you for your reply.

The database error hasn't occurred since April 4th, so it may have been resolved in the meantime.

However, we're currently facing two issues related to translations:

1. Translations are reverting to the original content;
2. Once reverted, the translations no longer accept any changes — for example, when I try to edit a translation, it reverts to the original content. If I attempt to update the text again to the correct language, it still reverts back to the original content.

All translations have been set to "Translate independently." In this case, the affected pages (both original and translated versions) have existed for over two years, and this issue has only recently started occurring. Given that the "Translate independently" setting was selected when the translations were created, I'm thinking this shouldn't be the source of the problem.

I’ve tested this behavior and found that it does not occur with newly created pages — it seems limited to pre-existing translations.

Could you please advise on how we should proceed?

Best regards.

April 15, 2025 at 2:24 pm #16934623

Otto

Hello,

Thanks.

I suspect that the translations were edited with different editors at some point. But it's just a guess 🙂

Can you provide me with an example page where I can see the problem?

I would like to request temporary access (wp-admin and FTP) to your site so that I can examine the issue more thoroughly.
It would be better to have a testing site where the issue is replicated.

The information you will enter is private, which means only you and I can see and have access to it.
Maybe I'll need to replicate your site locally. For this, I'll need to temporarily install a plugin called “Duplicator” or "All in One WP Migration" on your site.
This will allow me to create a copy of your site and your content.
Once the problem is resolved, I will delete the local site.

**IMPORTANT**
- Please make a backup of site files and database before providing us access.
- If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields.

Best Regards,
Otto

April 21, 2025 at 1:23 pm #16951896

Otto

Hello,

Thanks.

I noted that you are using the WP editor (Divi) to translate those pages.

Possible causes of the problem

  • Desynchronization between builders
    Avada offers two interfaces: the Backend Builder (wireframe mode editor) and the Live Builder (real-time visual editor). Although both use the same content structure, issues can arise if you switch between them without properly saving and updating.
  • Outdated cache
    The Live Builder may load a cached version of the content, which could overwrite recent changes made in the Backend Builder upon saving.
  • Automatic saving by the Live Builder
    The Live Builder saves changes automatically. If opened after editing in the Backend Builder without refreshing, it may overwrite the most recent changes.
  • Multiple sessions or simultaneous editing
    Editing the same page in multiple tabs or with different builders can cause saving conflicts.

Recommended steps to solve the problem

  • Update before switching builders
    After editing with the Backend Builder, save and reload the page before opening it in the Live Builder.
  • Avoid using both builders in the same session
    Always edit with only one at a time. Switching during a session can cause data loss.
  • Clear the cache
    • Clear the browser cache.
    • If you're using caching plugins (like W3 Total Cache) or server-side cache, clear it completely before editing.
    • Also clear the Avada cache at: Avada > Options > Performance > Reset Avada Caches.

✅ Final recommendation
Use only one builder per editing session. If you started with the Backend Builder, finish and save before switching to the Live Builder. And if you're going to switch, refresh first.

About the old content, I don't think you'll be able to restore it unless you have access to old post revisions.

Best Regards,
Otto

April 21, 2025 at 2:31 pm #16952012

mobintegL

Hi Otto, thanks for your message. I believe there may have been some confusion in your response — we’re using Divi, not Avada.

To clarify a few points:

- We always use the Divi Backend Builder, never the Live Builder.

- We do not switch between builders during editing sessions.

- Cache has been fully cleared.

- The issue occurs even when editing in a single session and tab, and it affects multiple users.

- All affected pages were set to “Translate independently” from the start, and this has been in place for years.

The issue we’re experiencing is that translations are reverting to the original language and no longer accept updates — and this only happens on older translated pages.

For example, if you visit this page: hidden link
— which currently displays correctly in English — and try to edit the text under the “Biografia” section (see attached image), you’ll notice that after saving, the content reverts to Portuguese.

Even if you then try to make changes to the now Portuguese content in the same page, those changes do not save either.

In some cases, I was able to restore the correct content using post revisions, but even after restoring, the same issue continues.

Could you please help investigate this further?

Thanks again for your help.

wpml.png
April 21, 2025 at 4:53 pm #16952464

Otto

Hello,

Please apoligize for the confusion. And thanks for the detailed clarification.

I made a copy of your site and deployed it locally. Then I disabled all plugins except WPML-related and temporarily. After that, I was able to edit the translation and the changes were saved.

Is it possible for you to try this on your end and confirm?

**IMPORTANT:** Please try this in a staging environment or at least with a backup of your site files and database before continuing.

If the issue resolved with these settings, reactivate one by one to see which conflicts.

Best Regards,
Otto

April 28, 2025 at 8:12 am #16973568

mobintegL

Hi Otto,

Okay, we will try to test this on a staging environment, I just wonder what could have happened since we've been using this method of translations since the beginning and this issue has never happened before.

I'll let you know what we find.

Thank you!

April 28, 2025 at 12:42 pm #16974859

Otto

Hello,

Thanks.

Not sure what may have caused the problem. WP core, themes, and plugins evolve, and an incompatibility may arise.

To dig deeper, before trying the test I suggested, you can do the following:
Please follow the instructions mentioned on this page: https://wpml.org/documentation/support/debugging-wpml/
Then, try to reproduce the issue and check your installation's **wp-content** folder to see if a file named **"debug.log"** was created (it will only be generated if a server error occurs).
If the file was created, please upload it to a platform like **Google Drive** or **Dropbox** (whichever you usually use) and share the link with me (make sure it is publicly accessible) so I can analyze it.

Best Regards,
Otto

April 30, 2025 at 1:10 pm #16984075

mobintegL

Hi,

Here is our debug.log hidden link

Let me know if you find anything.

Thank you!

April 30, 2025 at 2:14 pm #16984424

Otto

Hello,

I requested access to the debug.log file. Please let me know here when it's provided.

Also, please let me know if you manage to do the test I suggested here:
https://wpml.org/forums/topic/the-translated-pages-are-being-overwritten-with-content-from-the-original-pages/#post-16952464

Best Regards,
Otto

April 30, 2025 at 2:19 pm #16984474

mobintegL

Hi Otto,

I've granted you access to debug.log.

We are still working on the staging environment, I'll let you know what we find.

Thank you!

April 30, 2025 at 2:28 pm #16984500

Otto

Hello,

Thanks.

There are no Fatal Errors in the debug file. There is one recurring notice related to the code-snippets plugin.

I would start trying to deactivate that one first.

Let me know how the testing goes.

Best Regards,
Otto