Featured Image Fallbacks & Defaults shows an image wherever your theme shows a featured image, even on posts that don’t have one. It uses the first image in the post, or a default image you pick, so your archives, grids and related posts never have empty spots.
Before you start
- WordPress 6.2 or later
- PHP 7.4 or later
- A theme that displays featured images (most do, including the core Featured Image block)
Install
- In your WordPress dashboard, go to Plugins → Add New Plugin.
- Click Upload Plugin.
- Choose the plugin zip file.
- Click Install Now.
- Click Activate.
That’s it. The first-image fallback starts working as soon as the plugin is active. Setting a default image is optional.
How to use
How the fallback picks an image
When your site shows a post’s featured image, the plugin checks these in order and uses the first one it finds:
- The featured image you set. If a post has one, it’s always used.
- The first image in the post content. This is the first image anywhere in the post, including inside galleries, columns or groups.
- Your global fallback image, if you’ve set one (see below).
If none of these exist, the post shows no image, just like before.
Set a global fallback image
- Go to Settings → Media.
- Scroll to the Featured Image Fallbacks section.
- Next to Global fallback image, click Select image.
- Pick an image from the Media Library (or upload one) and click Use this image.
- Click Save Changes.
To change it, click Replace image. To stop using a default, click Remove image and save. The first-image fallback keeps working either way.
Where you’ll see it
The fallback shows up on the front end of your site, anywhere your theme or a block asks WordPress for the post’s featured image: blog and archive pages, Query Loops, single posts and related-post sections.
It doesn’t show in the dashboard or the block editor. There, a post without a featured image still looks empty, so you can always tell which posts are using a fallback.
Settings
- Global fallback image (Settings → Media → Featured Image Fallbacks): the image used when a post has no featured image and no image in its content. Only Media Library images can be picked. Default: none.
Developer reference
For developers: hooks and functions you can use from your theme or a code snippet.
featured_image_fallback_should_apply
Filter. Turns fallbacks on or off for the current request. Defaults to on, except in the admin and in REST requests, so the editor never shows a fallback as a real featured image.
featured_image_fallback_is_post_eligible
Filter. Decides whether a post can get a fallback. Receives $eligible and the WP_Post. By default, any post type that supports featured images, except attachments and revisions.
add_filter( 'featured_image_fallback_is_post_eligible', function ( $eligible, $post ) {
return 'product' === $post->post_type ? false : $eligible;
}, 10, 2 );
featured_image_fallback_content_image_url
Filter. Changes the URL of the first image found in the post content. Receives the URL and the WP_Post. Return an empty string to skip it and use the default image instead.
featured_image_fallback_resolved_image
Filter. Changes the final fallback for a post. Receives an array (or null for no fallback) and the WP_Post. The array’s type is 'attachment' or 'url'. The result is cached for the rest of the request.
FAQs
Does it replace featured images I’ve already set?
No. A featured image you set yourself always wins.
Does it change my posts?
No. The fallback is worked out each time a post is shown and is never saved as the post’s featured image. Deactivate the plugin and your posts are exactly as they were.
Which post types does it work on?
Every post type that supports featured images, such as posts, pages and custom post types with featured images turned on.
What if the first image in my post comes from another site?
It’s still used. Because it isn’t in your Media Library, WordPress can’t serve smaller, responsive sizes of it, so it loads at its full size.
What happens when I delete the plugin?
Deleting it from the Plugins screen removes the global fallback image setting. The image itself stays in your Media Library.
Can developers customize it?
Yes, with these filters:
featured_image_fallback_is_post_eligible: turn the fallback on or off for a post. Receives$eligibleand the post.featured_image_fallback_resolved_image: change or remove the image picked for a post. Receives the result (ornull) and the post.featured_image_fallback_content_image_url: change the URL of an outside image found in the content. Return an empty string to skip it.featured_image_fallback_should_apply: decide whether fallbacks run for the current request. By default they’re off in the dashboard and REST API requests.
// Don't use fallbacks on pages.
add_filter( 'featured_image_fallback_is_post_eligible', function ( $eligible, $post ) {
return 'page' === $post->post_type ? false : $eligible;
}, 10, 2 );