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.

This topic contains 15 replies, has 2 voices.

Last updated by Joe Westcott 3 years, 1 month ago.

Assisted by: Riffaz.

Author Posts
February 22, 2021 at 4:39 am #8141389

Joe Westcott

Issue:
WordPress database error: [Duplicate entry '2028-en' for key 'trid_lang']
UPDATE `wp_icl_translations` SET `language_code` = 'en' WHERE `translation_id` = '2371'

February 22, 2021 at 5:40 am #8141431

Riffaz

Hi,

Please provide your site login details in the next private reply.

Regards,

February 22, 2021 at 5:56 am #8141439

Joe Westcott

Done!

February 23, 2021 at 2:52 am #8149863

Riffaz

Hi,

We need to touch some tables in your database.
Could you please take a backup of your site and database?
Then, let us know.
We will fix it for you.

Regards,

February 23, 2021 at 3:50 am #8150271

Joe Westcott

Hi Riffaz, this dev URL is a test copy of the live site, so make any changes that you’d like.

Your changes won’t affect the live site.

And we can copy from live back to this dev site if needed.

February 23, 2021 at 2:55 pm #8155343

Joe Westcott

Riffaz, could you delete your screenshot, or else make that reply private? The screenshot contains slightly sensitive information, even if the credentials were incorrect.

February 24, 2021 at 10:43 am #8162259

Riffaz

Ok, thanks.
We are checking this.
I'll update to you again soon.

Regards,

February 25, 2021 at 6:11 am #8169359

Riffaz

Hi,

Could you please run this query on your database?

SELECT * FROM wp_icl_translations WHERE trid = 2028 AND language_code = 'en'

Then check the issue.
Now you may see the same issue with different trid.
Change the query and run again until this is fixed.

Let me know how it goes.

Regards,

February 25, 2021 at 6:16 am #8169361

Joe Westcott

Hi Riffaz, where do you want me to run this query — the test site that you’re using, or the live site?

Also, what do you want me to do with the results? Just paste them into a message to you, to let you know what I see?

February 25, 2021 at 6:33 am #8169399

Riffaz

Hi,

This will delete the duplicated value of trid.
You will have to open your database via cPanel or hPanel or any panel you have.
When you are in the database run this query on the 'sql' table.
Like this: hidden link
Upon Successful execution you will see a message like this: hidden link

Regards,

February 25, 2021 at 10:37 pm #8176431

Joe Westcott

Hi Riffaz, when I run the SELECT query that you shared, the system returns one row of data in response.

# translation_id, element_type, element_id, trid, language_code, source_language_code
'2369', 'post_attachment', '3845', '2028', 'en', NULL

Did you mean to send a different type of query than a select query?

February 28, 2021 at 4:29 am #8189341

Riffaz

Hi,

I can do this for you if I can access your database somehow.
MySQL Workbench loads, then nothing happens with your details.
And, I tested your site backend, front and in WPML setting but I do not see any error message anywhere.
Has this been resolved now?
If not, where do you see it and how can I access to your database?

as per your last reply if you still see the issue you will have to remove this row.

Regards,

March 1, 2021 at 11:15 pm #8201901

Joe Westcott

Hi Riffaz, I'd like to make the changes myself if feasible.

Two questions:

1. Are you looking for me to run the following DELETE query?

DELETE FROM wp_icl_translations WHERE trid = 2028 AND language_code = 'en'

2. What will I lose when I delete trid 2028 -- will I lose some existing translations?

...

I'm not sure why you saw the problem before but now you don't. Perhaps you already cleared up the problem on the test site that I shared.

March 1, 2021 at 11:17 pm #8201905

Joe Westcott

hidden link

By the way, your original screenshot -- linked above -- showed an empty query field. I'm guessing that you meant to send a different screenshot.

March 2, 2021 at 7:32 am #8204095

Riffaz

Hi,

1. not Delete, but Select. then delete the entries of the results except last.
if you use delete query directly that will delete all those duplicated entries including the original one.
so it's better first SELECT then check the results / number of rows
go one by one.

2. no but as I mentioned already it's better to have a backup first.

Regards,

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.