Skip Navigation

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

Problem: How to completely remove the images that are in the secondary languages that do not exist in the default language?

Solution: At this time, this is not possible with the WPML and its addons.

Using SQL would be possible to try to find records which are in the secondary languages and does not exist in the default language. Then use another query to delete it based on the trid column (translation id). But this should be a complex query.

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

Last updated by Jurgen 4 years, 2 months ago.

Assigned support staff: Bruno.

Author Posts
September 27, 2016 at 5:50 am #1101672

Jurgen

I am trying to: clean up the media library

URL of (my) website where problem appears: hidden link (for example)

I expected to see: as many items in all languages

Instead, I got: 1672 (EN) - 1700 (FR) - 1699 (NL) items

Steps to duplicate the issue: N/A

During the last months, items have been removed from the English media library but have not been removed from the FR and NL media library. As a result these files are still on the server (while sometimes file size was the main reason to upload a better version & delete the old one).

Is there a way
- to check which files are "too much" in other languages?
- to avoid having to delete an item from the media library in all languages?

FYI, the media translation settings are all checked (except for the first check box).

Thanks!

September 27, 2016 at 2:58 pm #1102872

Bruno

Thank you for contacting us.

The WPML uses the same image file for all languages. What is duplicated is the record in the database.

That is if you have the "image.png" file and 10 languages, WPML will use the same file in all languages.

=> to check which files are "too much" in other languages?
No. Unfortunately, it must be done manually.

=> to avoid having to delete an item from the media library in all languages?

On the WPML > Translation Management > Multilingual Content Setup > Posts and pages synchronization, you can select the "When deleting a post, delete translations as well" option.

When you remove the original image, the translations will be removed as well.

Note that this option is global, that is, when you remove a page or post, translations of the deleted pages/posts will also be deleted.

Please let me know if I can help with any other questions you may have.

Thank you.

September 28, 2016 at 7:09 am #1103359

Jurgen

I was aware that the file is the same, but DB records are created (but when I want to delete, I want to delete it "good")...

Unfortunately, checking 1700 items 3 times is not an option, as you can understand. Can't you imagine a SQL query or sorting or something else?

How does that setting work? We create all pages in English first, then we add translations. What if
- we delete a page translation (f.e. in NL or FR), what will be done to the original (EN)?
- we delete the original version (EN), then I assume the translations (NL & FR) will be removed too?

Best regards,
Jurgen

September 28, 2016 at 2:15 pm #1103834

Bruno

=> Can't you imagine a SQL query or sorting or something else?

Sorry, unfortunately not. Using SQL would be possible to try to find records which are in the secondary languages and does not exist in the default language. Then use another query to delete it based on the trid column (translation id). But this should be a complex query.

You can check more about the _icl_translations table in our documentation: https://wpml.org/documentation/support/wpml-tables/

=> we delete a page translation (f.e. in NL or FR), what will be done to the original (EN)?

Nothing happens to the original content.

=> we delete the original version (EN), then I assume the translations (NL & FR) will be removed too?

Exactly.

Please let me know if I can help in any other questions you may have.

Thank you.

September 29, 2016 at 10:16 am #1104529

Jurgen

OK, that' clear!