Recently, a WPBeginner reader asked how to bulk remove featured images (post thumbnails) from WordPress posts. At WPBeginner, we've covered featured images extensively—from adding them, creating custom sizes, regenerating thumbnails, to enabling multiple images per post. Now, we'll guide you through safely removing them in bulk across your site.
By default, WordPress requires editing each post individually to remove featured images. For sites with hundreds of posts, this is incredibly time-consuming. Our solution: a simple database query to unset featured images from all posts at once.
Critical Warning: This method removes featured images site-wide. It does not delete your uploaded images—they remain in the Media Library for reuse. Always back up your database first.
Paste this code into your active theme's functions.php file:
global $wpdb;
$wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_thumbnail_id'" );Save the file, and the query executes immediately, stripping featured images from all posts.
Essential Step: Remove this code right after saving. Leaving it will prevent setting new featured images.
We hope this expert tip from the WPBeginner team saves you hours. Questions? Drop a comment below.
Source: Kaiser