This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing an issue where media files are not being deleted from the upload directory when a post is deleted, regardless of the WPML setting "When deleting a post, delete translations as well". This occurs when the plugin is active and various Media Translation settings are enabled. Additionally, when WPML is deactivated, duplicated items appear in the Media Library.
Solution: We recommend checking the language of each image in the Media Library by changing the language on the top bar with WPML activated. To delete the images, use the Bulk Select option and then delete them. It is crucial to make a backup of the website before deleting the images, as this action is irreversible.
If this solution does not seem relevant to your situation, please open a new support ticket with us for further assistance.
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.
No matter if "When deleting a post, delete translations as well" is checked or not, media files will not be deleted from the upload directory, when the plugin is active. I have read about that workaround for an older version.
When I uncheck all settings under Media Translation, it works.
Set language information for existing media
Translate existing media in all languages
Duplicate existing media for translated content
Duplicate the featured images for translated content
When uploading media to the Media library, make it available in all languages
Duplicate media attachments for translations
Duplicate featured images for translations
Translate media library texts with posts
But I did not investigate in single step mode which one fires.
Can you tell me?
When I deactivate WPML, there are a lot of doubled items in the media Library.
Looks as they are orphants from the time, when all settings where default.
How cant I get rid of them? I would prefer a clean database, before I realy start to create translations.
Hello and thank you for contacting us.
Yes, upon upload if the setting "When uploading media to the Media library, make it available in all languages" then the media item will be automatically duplicated to the other languages.
To remove media items, you can go to the media library and use the admin language switcher on top of your site to switch to any other language and select the media that you want to remove and remove it.
The files will be removed once you have removed the last entry for the specific media items.
Meaning - if you have 2 languages, you have to delete the media item in both of them and removing the last language media item will remove the file itself.
For removing duplicates you can look for a plugin like "Media Cleaner" or similar in the WordPress plugin repository - but you should use it with caution and after making a backup of your site - so that you are on the safe side while performing removal operations.
When WMPL is deactivated, many files in the media library are listed twice. I guess, that's bechauce I have two languages. How can I find out, which one represents the standard language and which the additionell?
I want to Bulk Delete a lot of images and not always switch languages.
My name is Lucas and I'll assume your ticket for support.
To check to what language each image belongs, you can visit your Media Library and change the language on the top bar, like my colleague described (see attached screenshots. WPML must be activated). Once you change the language on the top-bar the images shown will be for that language. If you wish to delete them, you can select all by clicking on Bulk Select and deleting them all. Please make a Backup of your website before doing that, as deleting the images is irreversible.
Please let me know if that solves your issue.
Best regards,
Lucas Vidal
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.