This thread is resolved. Here is a description of the problem and solution.

Problem:Need to remove duplicate images from media library after deactivation of WPML

Solution: IF the WPML tables are still there, you can follow this process: * Go to Media > Library * In the WordPress admin bar, use the language selector to choose the language you want to remove. ** The media listed will be for that language. * Select all the media, and from Bulk Actions select Delete permanently. This will delete only the media for the selected language. (just make sure you dont delete the default language media)

Relevant Documentation:

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 6 replies, has 2 voices.

Last updated by Really 3 years ago.

Assigned support staff: Bobby.

Author Posts
June 16, 2017 at 1:21 pm #1299866

Really

Hi there,

I deactivated WPML. I don't need it anymore.

Doing that leaves lots of duplicate images in the media library that existed for each language - too many to delete manually. I need to remove these to tidy up my library.

I've seen other forum threads here about this issue and it looks like you have some script to run to purge these entries from the database.

Like in those other threads, I would like you to run it on my site for me.

Can you please help?

Thanks,
James

June 16, 2017 at 5:05 pm #1300037

Bobby
Supporter

Languages: English (English )

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

**Before we proceed I recommend to please take FULL BACKUP of your database and your website.**
I often use the Duplicator plugin for this purpose See: http://wordpress.org/plugins/duplicator/

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

You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you will enter is private which means only you and I can see and have access to it.

Thank you,
Bobby

June 16, 2017 at 7:33 pm #1300113

Bobby
Supporter

Languages: English (English )

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

Hello,

Are you planning on RESETTING WPML aswell? This will erase all your translated content/pages (usually not media) but if not everything is kept on the database so it can be used again when WPML is activated.

I have gone ahead and run the script within your theme's functions.php (removed now)

June 16, 2017 at 8:34 pm #1300131

Really

I'm not planning on resetting WPML yet, in case I do want to reactivate it.

But I did just deactivate WPML and could still see the duplicate images in the media library, so it doesn't look like the script worked.

What do you think?

I have left WPML active again.

June 16, 2017 at 9:50 pm #1300146

Bobby
Supporter

Languages: English (English )

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

Hi There,

If the script is not successful , the good thing is that you have not RESET WPML which means that the icl_ tables are still present.

Since the WPML tables are still there, you can follow this process:
* Go to Media > Library
* In the WordPress admin bar, use the language selector to choose the language you want to remove.
** The media listed will be for that language.
* Select all the media, and from Bulk Actions select Delete permanently. This will delete only the media for the selected language.
(just make sure you dont delete the default language media)

June 20, 2017 at 9:30 am #1301741

Really

Hi there,
Ok, thanks for the advice. It is difficult to remove so many duplicates manually so it's unfortunate the script did not work.

Can I ask... we are now noticing random images missing from the library. Is it possible that the script has inadvertently removed some images that we did not want to be removed?

Would there be any pattern to it to help us work out the best way to resolve it?

Sure we can work on a backup restoration plan, but we are now a few days road on a busy site, so that's not easy.

June 20, 2017 at 3:27 pm #1302139

Really

Closing this topic.