Skip Navigation

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

Problem:
The client is experiencing an issue where images deleted from the Media Library in the default language (English) are not being removed from the Spanish Media Library on their multilingual website.

Solution:
We explained that in WordPress, media is treated as a post type, which means that deleting an image in one language does not automatically delete its translation. To resolve this, we recommend the following steps:
1. Navigate to WPML > Settings > Posts and Pages synchronization.
2. Check the box labeled "When deleting a post, delete translations as well".
3. Scroll down and click the blue "Save" button to apply the changes.

It's important to note that this setting will only apply to new deletions and will not affect media that has already been deleted without a corresponding translation. For media that has been deleted prior to this setting change, the translations will need to be removed manually.

If this solution doesn't seem relevant to your situation, please feel free to open a new support ticket with us.

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 1 reply, has 2 voices.

Last updated by Christopher Amirian 3 years, 4 months ago.

Assisted by: Christopher Amirian.

Author Posts
November 23, 2021 at 4:04 pm #10053881

klausG-10

Dear,

We are using WMPL premium plugin, and our website has two languages: English and Spanish.

We were trying to clean Media Library and remove unused images, so we have deleted bunch of images in default Media Library (English).

But then, when we switch to Spanish language in WP admin bar, all those images are still there, like there were never deleted.

So, I was hoping to get some explanation what is going on there, do we need to remove images in Spanish Media Library as well, how to make sure images are really deleted from the server, and can we somehow sync those two Media Libraries, but not keep different alt img and title attributes?

Attached is compression between English and Spanish media library, where you can easily see more images in Spanish media library.

November 24, 2021 at 10:39 am #10058745

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi there,

As the media is treated as a post type in WordPress it will not delete the media database entry for the translated language if you only delete the original one. And you need to delete the translated one too.

But if you want to automate the process you can follow the steps below:

If you want to sync deletion between the main language and its translations, please go to WPML > Settings > Posts and Pages synchronization > check the box "When deleting a post, delete translations as well" and then scroll a bit and click the blue "Save" button.

Please consider that the steps I mentioned will not work on the already deleted media as there is not original language item now to sync between. It will work for the new images that you delete

Thank you.