WordPress is getting bigger day by day with the new developers evolving in the industry of web design and development. In this way, we as developers try our best to share our coding snippets online to help other developers and save each others’ time. Right!
NOTE: Before you run the following SQL query be sure to have a backup of your database. It works for me.
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 with missing 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"
Here is how it looks like in PHPMyAdmin:
You can use your post ID’s to access the posting page directly:
This is the easiest way to get all the published posts in one place that has not featured image set. We can use the WordPress query as well on has_post_thumbnail to list down posts that have no featured image. You can comment down below if you need WordPress query 🙂