WP_Query All Posts That Have No Featured Image

What if you needed to get a list of all posts in WordPress that have no featured image (also known as the post thumbnail)?

Here you go:

<?php
$args = array(
'post_type' => 'post',
'posts_per_page' => -1
);
$the_query = new WP_Query( $args );
if ($the_query->have_posts()) {
while ( $the_query->have_posts() ) {
$the_query->the_post();
if (has_post_thumbnail()) continue; // this will skip all images WITHOUT a featured image
?>
<!-- Do as you please here! -->
<?php
} // while have_posts()
wp_reset_postdata();
} else { // if have_posts()
?>
<!-- All posts have a post thumbnail -- >
<?php
} // else
?>

Up Next: How to Remove sourcebuster.min.js From Woocommerce