Created
March 9, 2024 03:17
-
-
Save Acephalia/9260cb83b0e906132fbbfed9d87edc26 to your computer and use it in GitHub Desktop.
Woocommerce Remove Gallery Images
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This SQL query wll remove all gallery images from all Woo products but leave the Product Image in tact. It will not delete the images from the media gallery. Just detach them from the gallery. | |
DELETE pm | |
FROM pwj_postmeta pm | |
INNER JOIN pwj_posts p ON pm.post_id = p.ID | |
WHERE p.post_type = 'product' | |
AND pm.meta_key = '_product_image_gallery'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment