Please make sure to update to WPML 4.3.6 and check our list of Known Issues before reporting

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

Last updated by Riffaz 12 months ago.

Assigned support staff: Riffaz.

Author Posts
February 26, 2019 at 2:01 pm #3245242


I am trying to:
Remove media that was duplicated by WPML media translation

I'm using Offload Media to load images from Amazon S3 but I'm having issues with WPML. Here is the developer's statement:

The problem is down to the site using WPML's "duplicate media" options, which means new Media Library items have been created for each language but which use the same files on the server.

Because you're using the "Remove Files From Server" option, when the Media Library item for one language is offloaded the file is then removed from the server, then when WP Offload Media tries to offload it for another language it can not access the file because it has been removed.

Since WPML 4.0.3 there has been "Media Translation Management" which means you do not need to duplicate media anyway (which is non-standard and breaks many things in WordPress) and instead can translate the captions for media that is used in multiple posts. If a media library item has words in it that means a **new** image is needed, then it is added via media translation management for the second language and the translated post for that language use that image. The additional image is happily offloaded by WP Offload Media because it is a new Media Library item that has its own files.

So how can I easily disable/remove the duplicated media without breaking the site?

February 27, 2019 at 4:12 am #3248455


Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi there,

Thank you for contacting WPML support.

how can I easily disable/remove the duplicated media without breaking the site?
Have you already deleted the WPML tables from the database? If so you will need to delete the media files one by one. If WPML tables is 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: hidden link
** 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.

This is the only way do it for now via WP dashboard.
You can use a query to do this as well but this may cause some issue if you do it with slight mistakes.
If you still want to use SQL query to remove them we suggest you to consider this: since it is a custom work.


February 27, 2019 at 11:42 am #3249929


Thank you Riffaz.

How can I make sure that duplicate media won't be created from now on?

February 27, 2019 at 2:27 pm #3250808


Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)


You are welcome!

How can I make sure that duplicate media won't be created from now on?
- this is possible only if you disable the "Media Translation"