Skip Navigation

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

Last updated by sergeyS-14 2 years, 7 months ago.

Assigned support staff: Yvette.

Author Posts
February 18, 2019 at 12:38 pm #3212229


Hi there! Because of a lot of images we have (90k aprox and will be more)

We wold like to disable Media Translation and delete all unnecessary data form database.

Can you please describe me an example to delete unnecessary data from database if i am will not use Media Translation?

In my plan i wold to this SQL: "DELETE FROM wp_icl_translations WHERE element_type = 'post_attachment';"

Is it enough only delete image related rows from _icl_translations table? Or there is more i need to delete?

Thank you.

February 19, 2019 at 7:33 am #3215270


Languages: English (English ) Spanish (Español )

Timezone: America/Los_Angeles (GMT-07:00)


Will these images be viewed/viewable from all language spaces when navigating your site?

If so, you will need the duplicated attachment entries the images for them to be seen. Otherwise, you may encounter blank spaces or grey image placeholders in secondary languages on the frontend

I would strongly recommend to first test the impact on the frontend with a few test cases before executing a massive delete.

However, to answer your technical question, to remove the affects of WPML Media, you will need to reverse the steps that you find here:
WPML > Settings > Media Translation

5. Remove the checks from all options on this panel
4. Remove all references to the featured image custom field in secondary language posts (table: post-meta)
3. Remove all media attachment entries with parent posts in secondary languages (table: wp-posts)
2. Remove all secondary media attachment post types from Media Library (table: wp-posts)
1. Remove all language information for remaining media (table: icl_translations)

The best order to execute those steps in is something you will need to test yourself but I do think you will need to write severa queries using the icl_translations table as a directory. It might be easier to just eliminate all of your media and re-install the content from scratch with all Media options turned off - but this depends on your state of existing content in other langauges.

There is no way to turn off Media Translation in the core product apart from making sure you do not check any of the Step 5 options. But once again, I emphasize, you may not be able to visualize any images in secondary languages on your frontend.

I hope this answers your question.

February 19, 2019 at 9:04 am #3215601


My issue is resolved now. Thank you!