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, 10 months ago.

Assisted by: Riffaz.

Author Posts
March 4, 2021 at 11:44 pm #8232421

Joe Westcott

My issue is resolved now. Thank you!

If it helps anyone else who stumbles across this in future, if you get these errors, you can look at the 'trid' in the error, and use that in your query to find all the items that are affected.

So for example if you see this in your error:

Duplicate entry '16-en' for key 'trid_lang'

Then you can query like so:

SELECT * FROM wp_icl_translations WHERE trid = 16;

This will show you a few entries. Look at each 'element_id', and you can see whether you want to keep it or delete it by going to this URL:

hidden link{yoursitedomain}/?p={element_id}

So for example if 'trid' 16 has a few entries and one of them is element_id 222, then go to this URl to see what that is:

hidden link{yoursitedomain}/?p=222

You can compare the different element IDs and see whether you want to delete one of them because it's set up incorrectly as a duplicate.

These items could be pages, posts, attachments, or any type of data that WordPress stores.

Once you delete the unwanted item, the errors will be gone.

I believe that Riffaz's solution would also work, where you just delete one of the entries within each trid without touching the element that's causing the problem.

But if you do that, then you'll possibly get rid of the errors but still have a bunch of duplicate content hanging around, possibly causing trouble elsewhere.

So if you want to keep things clean and working well, consider deleting the duplicate content itself.

I hope this helps!

-Joe Westcott