A
A
awak6e2020-07-27 17:07:36
WordPress
awak6e, 2020-07-27 17:07:36

Woocommerce unattached images sql query?

Hello. It so happened that the site has 140,000 extra (unattached) product images. Is it possible to delete via sql query?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan Hasanli, 2020-07-28
@azerphoenix

You can, of course. But you need to look in the database which field is missing, when when the picture is not attached to the record.
Look for post_type=attachment Well, most likely the post_id field or some other parameter that links the image to the post will be missing. Orient yourself on it. And then a regular SQL query
Also see:
https://wordpress.stackexchange.com/questions/1632...
https://wordpress.org/plugins/dnui-delete-not-used...
https://wordpress .org/plugins/media-cleaner/
well, before editing, do not forget to backup the database

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question