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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: America/Los_Angeles (GMT-08:00)

Tagged: 

This topic contains 10 replies, has 2 voices.

Last updated by Bobby 1 year, 1 month ago.

Assisted by: Bobby.

Author Posts
September 28, 2023 at 3:46 pm #14483337

peterJ-48

Hi,

We have a problem with duplicate image entries (Image ID’s) in our media library. The problem appears to be pretty random. It does not happen for all images.

Our site is a multivendor e-commerce site with 20 languages (English is the base language). The WPML Media plugin is activated. Right now we are only translating title, alternative text, description etc. but we will later on need an image for each language for our help menus etc.

Some observations:
- We only see duplicate image entries in the base language (English)
- The number of duplicates appear to be pretty random and can also be more than 20.
- We have had the problem from the beginning when we implemented WPML. In the beginning we thought it only had to do with images that was uploaded before we implemented WPML and we deleted all the duplicated images manually, but the problem still persist – also for images uploaded after we implemented WPML.
- We think the problem can be happening when we restore a database backup, but this is not something we are sure about.

We have a completely separate staging site and it will be possible to supply you with login/ftp access so can analyse the problem.

I have attached an image with our current settings for media translation.

Hope you can help.

Settings-media-translation.JPG
October 2, 2023 at 4:43 pm #14499451

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Hi there,

I would like to ensure I fully understand the issue you are experiencing.

You currently are getting duplicate media in your default language only, correct?

Your site uses 20 languages, the way WPML Media translation works is by creating a database entry per media per language in the database, therefore if you were to deactivate WPML you would see the same media 20 times (one per language) this does not affect the disk space as these are just database entries.

October 2, 2023 at 5:12 pm #14499549

peterJ-48

Hi Bobby,

“You currently are getting duplicate media in your default language only, correct?”
Answer: Yes, I am getting duplicate media id’s in the default language only.

“Your site uses 20 languages, the way WPML Media translation works is by creating a database entry per media per language in the database, therefore if you were to deactivate WPML you would see the same media 20 times (one per language) this does not affect the disk space as these are just database entries.”
Answer: I am aware of that.

I have attached an example of an image that’s gone wrong. On the picture drip-nozzle-english you can see that when the English language is selected, I have 26 image entries for the same image. On the picture drip-nozzle-all-language you can see that when all languages are selected, I have 45 image entries.

drip-nozzle-all-language.JPG
drip-nozzle-english.JPG
October 2, 2023 at 5:34 pm #14499731

peterJ-48

Hi Bobby

One more observation: During troubleshooting at our staging site we found that if we press "Set language information" in WPML > Support > Troubleshooting, it will generate duplicate images in the media library.

October 3, 2023 at 4:48 pm #14507497

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

I would like to request temporary access (wp-admin and FTP) to your site to test the issue.
(preferably to a test site where the problem has been replicated if possible)

**Before we proceed It is necessary to take FULL BACKUP of your database and your website. Providing us with access, you agree that a backup has been taken **

I often use the Duplicator plugin for this purpose: http://wordpress.org/plugins/duplicator/
You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you enter is private which means only you and I have access to it.

NOTE: If access to the live site is not possible and the staging site does not exist please provide me with a duplicator package created with the duplicator plugin.

Thank you,
Bobby

October 5, 2023 at 3:04 am #14516169

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Thank you for providing me with the access details!

I understand you said that you are able to reproduce this behavior when running Set language information" in WPML > Support > Troubleshooting

are there any other actions that would reproduce this behavior?

For example, uploading a new media.

October 5, 2023 at 6:30 am #14516857

peterJ-48

Hi Bobby,

Peter here.

As mentioned in my first mail we think the problem can happen when we restore a database backup, but at the same time I have to say, that our developer has tried to restore a backup on one of our development sites to see if we could recreate the problem, but here we did not find any additional duplicates.

I remember one incident in autumn 2022 where we were setting up and translating a product. The following day we noticed that there were duplicate product images in the English language, but also at that time we were not able to recreate the problem.

Like mentioned have we seen the problem from the beginning when we implemented WPML and to begin with we thought it was only happening for images that had been uploaded before we started with WPML. At that time (11. July 2022) I was having a chat conversation with Bruno Kos. I do not know if this can be of any help, but I have linked to the chat conversation below. When you read the chat then please bear in mind that at that time we were brand new to WPML.

https://wpml.org/forums/topic/wpml-chat-support-ticket-by-peterj-48-1657537942/

Ps: I noticed that our developer only send you the credentials for WP. If you need a FTP access just let us know.

October 6, 2023 at 5:23 pm #14530585

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Hi Peter,

Thank you so much for updating me! I reviewed the previous ticket you had with my colleague and can see that he recommended the workaround in this errata https://wpml.org/errata/all-media-is-duplicated-when-a-new-language-is-added/ as well as a workaround to remove the duplicate media.

Apart from the errata issue, a time we would see such a behavior is this:

1. You have WPML with the languages connfigured
2. You delete WPML and remove it from the site ----> this results in all the media now to show duplicated as many times as you had languages (20 languages = 20 duplicates) [in this case as long as the plugin is not RESET simply enabling it fixes this]

3. You RESET wpml this causes the same results. [no fix for when WPML is reset]

The way the media translation is handled in the database is by creating a database entry per language per media. Therefore your media-1 will now have 20 entries in the database.

If at any moment during your workflow the database and WPML's settings are disturbed this could happen, I am not aware of any known issues regarding this and any actions that would cause this, but do you ever notice that your team has to re-configure WPML at all?

The problem with an issue such as this is that it can be 'random' meaning that we have no means of reproducing it, and this way we don't have a clear way to further test this behavior

October 9, 2023 at 7:10 am #14536305

peterJ-48

Hi Bobby,

Peter here.

Thank you for your message. Let me try and discuss this with the developers and come back to you.

October 17, 2023 at 12:05 pm #14593959

peterJ-48

Hi Bobby,

We found out that if we press “Set language information” under WPML > support > troubleshooting a lot of duplicate media entries is generated in the English media library, but if we then delete the duplicate entries and press “Set language information” again, then no new duplicates are generated.

We will now go ahead and delete all the duplicate entries (more than 6000 entries). When we are able to translate again, we will need to test what happens with products that are translated after we have been pressing “Set language information”.

October 17, 2023 at 4:25 pm #14596611

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

That is quite a large amount of media!

Please keep me updated with your results

The topic ‘[Closed] Duplicated images in the Media Library’ is closed to new replies.