# Posts Missing a Featured Image Widget

> Adds a dashboard widget listing the latest published posts that have no featured image, with edit links, so social shares and archive pages never show blank spaces.

- Type: PHP
- Runs: Admin only
- Category: [Dashboard](https://wpide.com/library/category/dashboard/)
- Tags: dashboard-widget, featured-image, content-audit
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/dash-missing-featured-images-widget/

## Code

```php
// Post type to check.
$wpide_thumb_check_type = 'post';

add_action( 'wp_dashboard_setup', function () use ( $wpide_thumb_check_type ) {
    wp_add_dashboard_widget( 'wpide_missing_thumbs', 'Missing featured images', function () use ( $wpide_thumb_check_type ) {
        $query = new WP_Query( array(
            'post_type'      => $wpide_thumb_check_type,
            'post_status'    => 'publish',
            'posts_per_page' => 10,
            'meta_query'     => array( array( 'key' => '_thumbnail_id', 'compare' => 'NOT EXISTS' ) ),
        ) );

        if ( ! $query->have_posts() ) {
            echo '<p><span class="dashicons dashicons-yes-alt" style="color:#00a32a" aria-hidden="true"></span> Every published post has a featured image.</p>';
            return;
        }

        printf( '<p>%d posts without a featured image. Latest:</p><ul>', (int) $query->found_posts );
        foreach ( $query->posts as $post ) {
            printf( '<li><a href="%s">%s</a> <small>%s</small></li>', esc_url( get_edit_post_link( $post ) ), esc_html( get_the_title( $post ) ), esc_html( get_the_date( '', $post ) ) );
        }
        echo '</ul>';
        printf( '<p><a href="%s">See all</a></p>', esc_url( admin_url( 'edit.php?post_type=' . $wpide_thumb_check_type . '&wpide_thumb=without' ) ) );
    } );
} );
```

## Notes

Shows up to ten posts; change the post type in $wpide_thumb_check_type.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Posts Missing a Featured Image Widget" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
