How to Find WordPress Posts That are Without Featured Images

WordPress is still dominating in the field of content management systems, with new developers joining the web’s leading community of web design and development every day.

As developers, we try our best to share our coding snippets online to help other developers and save each others’ time.

NOTE: Before you run the following SQL query, be sure to have a backup of your database.

Find posts without featured images via PHPMyAdmin in WordPress

If you are looking to find posts on your WordPress site that has no featured image, then you should run the SQL query on PHPMyAdmin in the table wp_posts in your database. You will be able to get all the posts that are missing a featured image:

SELECT * FROM `wp_posts` WHERE ID not in (select post_id as p from wp_postmeta where meta_key like "_thumbnail_id") AND post_type = "post" AND post_status ="publish"

The wp in wp_posts needs to be replaced with your own database table name, if it’s been changed. For example:

SELECT * FROM `ourtable_posts` WHERE ID not in (select post_id as p from ourtable_postmeta where meta_key like "_thumbnail_id") AND post_type = "post" AND post_status ="publish"