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 Mario 3 months, 1 week ago.

Assigned support staff: Lauren.

Author Posts
July 11, 2019 at 10:59 am #4188897

Mario

I am trying to: delete media duplicates and files of media that do not exist in main language

I expected to see: an option to do so just like WPML can create media translation it should be possible to delete media translations or at least list media files that are out of sync.

Instead, I got: No way to actually delete the files on the server if I have the option "Delete post in all languages" in the WPML settings not set before deleting any files. Media and post should be treated differently in this regard or there should at least be on option to list media files that do not exist in all languages. Is there any way to remove the duplicates in the database and the actual files on the server now that we have spend days to clean out the media library of a customer only to find the files still on the server?

Any help is much appreciated
Mario

July 11, 2019 at 1:54 pm #4190499

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Hi Mario, thank you for contacting WPML support. I'll be happy to help you with this.

When media is translated, it does not actually create a duplicate of the media file, but rather a second entry in the database. You can delete these translated media by going to Media Library. Then, use the admin language selector at the top of your dashboard to switch to your secondary language. Now you will see all media that has been translated to each language. You can view the media as a list, select all and then delete.

If you have already done these steps, then please be sure to make a full backup of your site and database. Then, go to WPML -> Support -> Troubleshooting. Look for 'Clean up' and click the following:
- Synchronize posts taxonomies
- Clear the cache in WPML
- Remove ghost entries from the translation tables
- Fix element_type collation
- Set language information
- Fix Terms count
- Fix post assignment for translations

Please let me know if you need any further assistance and I will be happy to help.

July 11, 2019 at 2:18 pm #4190791

Mario

Hello Lauren,

thank you for your response. The problem is not so much the database, as cleaning up translations entries of files that have been deleted in the admin language should be easy once the actual files are deleted. The main problem is, that the files are still on the server, even tho I have deleted them in the admin language. I understand that we made a mistake here by not checking the option "delete translations if post is deleted" before deleting them.

To be clear:
-We have deleted around 40% of the entries in the media library in admin language
-They are still there in the translation, and working out now wich ones are deleted in admin lang and wich ones are still in use manually, is not an option. I understand, the solution you gave might fix that.
- The main problem - since it kills our runtime on backup - is that the files of the entries we deleted in admin language are still physically on the server and can't be deleted manually (eg. via FTP) since some are still in use and some are not (insane amount of workload to filter them by hand).

If I understand correctly, the suggested "cleanup" effects only the database? Or does it also actually remove the files from the server?

Thank you for your help.
Mario

July 11, 2019 at 4:13 pm #4191817

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

The cleanup will only affect the database, it will not remove files from the server. If you have a backup, I would recommend installing the backup so that you can follow the steps in my first response and make sure that "delete translations if post is deleted" is selected. Otherwise, you will have to manually remove the unneeded files.

You may want to see if the cleanup steps resolve a lot of the issue and if not, perhaps restore a backup. Let me know the results and if you need further assistance, I can further troubleshoot.

July 14, 2019 at 11:29 am #4205431

Mario

Hello Lauren,

that is very unfortunate but ok, I will have to deal with it. Since we did the cleanup, because our backups were failing we do not have a backup that is up to date. I would like to add this as a feature request: Add an option to delete files from media library that are not present in the main language. I have found quite some entries here in the forums regarding this problem. People solved this by deleting the files again after said option was checked, which might be fine for small websites. Or at least have an option to show all media files that are not present in all languages like we can do with post and pages etc. in the translation management overview (simply add attachments to the post type filter dropdown). This way it would be very easy to manage media translations as well, which might be handy in general to see attachments that do not have translated titles, captions etc.

I guess thats it, kind regards
Mario

July 15, 2019 at 4:44 pm #4213413

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Hi Mario, here is a link to our feature request form, so that you can officially submit the request for these features: https://wpml.org/suggest-a-new-feature-for-wpml/

Our developers will review and decide if they will implement the changes. Thanks so much for your feedback, we do appreciate it!

July 15, 2019 at 7:48 pm #4214425

Mario

I am gone file a feature request.