Skip to content

Instantly share code, notes, and snippets.

@ValeriiVasyliev
Created February 1, 2022 09:26
Show Gist options
  • Save ValeriiVasyliev/5d21bd4beb482f94b429bb9b89c686e2 to your computer and use it in GitHub Desktop.
Save ValeriiVasyliev/5d21bd4beb482f94b429bb9b89c686e2 to your computer and use it in GitHub Desktop.
WordPress : bulk deleter all images
DELETE FROM `wp_posts` WHERE `post_type` = "attachment";

DELETE FROM `wp_postmeta` WHERE `meta_key` = "_wp_attached_file";

DELETE FROM `wp_postmeta` WHERE `meta_key` = "_wp_attachment_metadata";

DELETE FROM `wp_postmeta` WHERE `meta_key` = "_thumbnail_id";

UPDATE `wp_postmeta` SET `meta_value` = NULL WHERE `meta_key` = "_product_image_gallery";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment