How to Create a Default Featured Image for WordPress Blog Posts
How to Create a Default Featured Image for WordPress Blog Posts
Featured images are an essential part of every blog post’s identity; not just for the website, but for any place online where it might be shared.
WordPress does have a designated spot where you can easily upload a featured image for each post. However, it’s easy to overlook it when you’re busy trying to write a post, edit for readability, optimize for search, and schedule it to publish on the most optimal day and time.
So, what do you do? Hope that no one cares if your post is missing a featured image? Catch it after the fact and throw one in quickly, hoping that not too many visitors on the site or followers on social media noticed?
Nope. There’s a better solution for this: You can create a default image for blog post thumbnails.
How to Create a Default Image for Blog Post Thumbnails
Ideally, every blog post on your website will have a unique featured image associated with it.
As I already mentioned, adding a featured image isn’t always on the list of priorities when you’re working on creating a blog post (though it really should be). While you wouldn’t want to rely on a default featured image thumbnail to represent each and every one of your posts (think about how silly that screenshot above would look if the same image were used for each), it’s a good practice to have a backup in place.
We all know how important images are to the users’ experience when reading content. They’re just as important in luring in visitors, followers, and newcomers to your posts. The enticing meta descriptions or post summaries are good and all, but the image? Well, the image often convinces people to actually read those descriptions in the first place.
You may have noticed – but most likely not – that we have a default featured image set up for the WPMU DEV blog. It appears for older posts in our archives, which, for whatever reason, are missing a featured image.
So, this is why you need a default blog post thumbnail set up for your WordPress site—for those rare occurrences when you forget to associate one with a post.
In terms of setting this up, there are three methods by which you can add a default image so no post will ever go featured image-less again. But first, you’ll need to upload the default image you want to use to WordPress. Typically, a business logo, branded image, or recognizable mascot is the best option for this:
Option 1: Code It In
You can hard-code a default featured image into your theme’s file. This way, any time a post thumbnail is not present, it will automatically pull in the default one you uploaded to WordPress.
Open your child theme file.
Add this code to the_post_thumbnail() function:
Update the “default-image.jpg” part of the code to the actual name of the featured image file you uploaded to WordPress.
Save your changes.
Option 2: Use the First Post Image
If your blog posts already have images included within the content, then you shouldn’t need to assign a default, generic image to them. The image content already exists; it just wasn’t slotted into the featured image widget.
So, here is what you do:
Add this to your theme’s function.php file:
You’ll then have to add this code to your child theme file so the first image found in each post will be assigned as the thumbnail if there is no featured image:
Save all your changes.
1.6 million WordPress Superheroes read and trust our blog. Join them and get daily posts delivered to your inbox - free!
Option 3: Use the Quick Featured Images Plugin
The Quick Features Images plugin is a great choice not just for assigning a default post thumbnail, but also because it gives you more overall control of your featured images. It will help you:
- Bulk edit featured images
- Update featured images right from within the Posts main page
- Create rules for which default featured image will be applied to posts
The premium version of the plugin enables you to assign the first post image as the featured thumbnail. It also will create a featured image from other content in your post, like a photo gallery, the home page’s main image, or embedded video content.
Curious to see how the free version works? Let’s take a quick look:
Once you’ve installed and activated the plugin, quickly take a look at the settings. There isn’t much to define, but you’ll at least want to review the new column options this plugin wants to add to WordPress.
If you visit your main Posts or Pages lists, you’ll then see that each entry either has a featured image associated with it:
Or no featured image associated with it:
This will be a big time-saver going forward when you’re curious as to which pages or posts actually have thumbnails assigned to them.
As you can see, there are different actions you can take beneath each of the featured images (or lack thereof) within these lists. However, our concern today is on how to easily create a default post thumbnail without having to tediously deal with each featured image-less post.
So, return back to your new Featured Images menu tab. Go to Preset Featured Images.
You’ll be given three rules to set:
The first will ask if you want to automatically assign the uploaded featured image to every blog post, regardless of whether you have a featured image or not. This option won’t be ideal for most of you as it means every post will have the same image.
It’s really only a good option if you set rules for how featured images are assigned to posts and pages and you have categories and taxonomies that would benefit from using the same uniform image. This could possibly work for case study pages, product categories, or posts authored by specific people.
The second rule will achieve the same effect as option #2 above. However, you’ll have the benefit of not having to hard code this into your theme files while also getting to choose which page types you want this rule to apply to (so it wouldn’t just be blog posts).
The final rule is the one everyone should experiment with. Even if you choose not to define different featured images for the various types of content on your blog, you’ll still at least need to upload your preferred default image here. As you can see from the example above, you don’t have to use the same exact image for all of your posts. If you want each thumbnail-less post to still have a relevant image assigned to it, you can establish that here.
Once you’re done, save all your changes.
So, there you have it. Yet another way to automate the process of covering all your bases in WordPress. Although this one may not seem as significant as some of the other methods we’ve discussed in the past, remember that images are really important to the user experience. This is true not just here in WordPress, but also around the web as others encounter your content on social media, in RSS feeds, and so on.