Beginner's Guide for WordPress / Start your WordPress Blog in minutes

How to Add Featured Images or Post Thumbnails in WordPress

Featured images also known as post thumbnails are a well-known WordPress feature supported by most themes.

They are the primary image for your blog posts, and they often appear next to the heading on your home page and social media. All popular WordPress themes come with built-in support for featured images.

In this article, we’ll show you how to easily add featured images or post thumbnails in WordPress.

Adding featured images in WordPress

Beginners Guide to Featured Images in WordPress

Featured images are a WordPress theme feature. Almost all WordPress themes come with built-in support for featured images and display them beautifully across different areas of your WordPress website.

Featured images preview on a typical WordPress blog

As humans, we find visual elements more engaging than plain text. Featured images help you make your blog pages look more appealing.

They also help you build user engagement and increase page views. Search engines and social media websites may also use these images and display them in search results and social media news feed.

Mostly featured images are used for blog posts, but you can also set featured images for pages and custom post types.

Note: Featured images are not the same as cover image. See the difference between cover image vs featured image in WordPress.

That being said, let’s take a look a how to easily add featured images in WordPress.

Video Tutorial

Subscribe to WPBeginner

If you’d prefer written instructions, just keep reading.

Adding Post Thumbnail or Featured Image in WordPress

To add a featured image in a WordPress post, simply edit or create a new blog post.

In the content editor, you’ll find the featured image tab in the right column.

Featured image section on post edit screen

You need to click on the ‘Set Featured Image’ area, and this will bring up the WordPress media uploader popup.

From here, you can upload an image from your computer or use an existing image from your media library. Once you select the image, simply click on the Set Featured Image button.

Setting a featured image

WordPress will now show a preview of the featured image in the right column. However, the actual featured image would look different depending on your WordPress theme.

You can now save or publish your post and preview it to see how the featured image will appear on your live website.

Depending on settings defined by your theme developer, your featured image will automatically appear with your posts.

How to Find and Effectively Use Featured Images?

Now, the next big question that most beginners come across is where to find images to use as featured images?

You cannot just use Google image search and use any image from the internet. Those images are protected by copyright laws and using them without proper permission can cause legal trouble.

Luckily, there are several resources available that you can use to find free images for your blog posts.

Our top favorites are:

  • Shutterstock – They have a few free images, but the real value comes from their paid plans which give you access to tons of high quality photos, illustrations, drawings, videos, and more. This is what we use for WPBeginner site.
  • Unsplash – A popular online resource publishing high-resolution images that you can use on your website and other projects.
  • Negative Space – A well-organized collection of copyright-free images.
  • New Old Stock – A collection of vintage photographs from public archives.
  • Unsplash is a popular free image resource for bloggers

    Note: All these sources provide high-resolution images, which means they are large in filesize and dimensions. You’ll need to optimize images for the web before using them as featured images.

    Featured images are handled by your WordPress theme. In order to change how your theme displays featured images, you’ll need some basic CSS or WordPress coding skills.

    If you are comfortable with coding, then continue reading for more tips.

    Theme Developers Guide to Featured Image and Post Thumbnails in WordPress

    The featured image is a popular feature supported by almost all WordPress themes. In rare situations, you may come across a theme that does not support featured images, or you may not like how they handle feature images.

    In that case, you can add featured image support to your theme or change how it appears.

    If you are comfortable editing WordPress theme files and know your way around a little custom CSS, then you can do it yourself.

    If your theme does not support featured images, then you’ll not see the option to add a featured image in the content editor.

    To add featured image support in a WordPress theme, you need to add this line of code in your theme’s functions.php file:

    add_theme_support( 'post-thumbnails' );
    

    This code will enable featured image support for posts and pages. You can now go to posts or page block editor, and you will see the featured image option enabled.

    However, when you set a featured image, it will not automatically display in your WordPress theme. To display featured images in your theme, you need to edit your templates and add this line of code where you want to display the featured image:

    <?php the_post_thumbnail(); ?>
    

    The files you add the above code in will vary based on your theme. You will want to add the code inside your post loop.

    Related: See WordPress theme hierarchy cheat sheet to better understand how themes work.

    The above code is the basic function that you need to add featured image support and display featured images in your theme. To set image size for featured images you upload, you need to add this line of code to your functions.php file.

    set_post_thumbnail_size( 50, 50);
    

    The parameters for set_post_thumbnail_size are in this order: width, height.

    You can also set additional image sizes to use with the_post_thumbnail() function. For example:

    // Image size for single posts
    add_image_size( 'single-post-thumbnail', 590, 180 );
    

    In this example we have added a new image size called single-post-thumbnail with 590px with and 180px height.

    To use this image size in our theme, we will still need to add it to the appropriate theme file.

    Checkout our guide on adding additional image sizes in WordPress for more details.

    If you have previously uploaded featured images, but they are still appearing in some other size, then you need to regenerate thumbnails and image sizes for older posts.

    Below is an example of the featured image function with specific image size.

    <?php the_post_thumbnail( 'single-post-thumbnail' ); ?>
    

    This is the broken-down version of the full functionality. There are many other things you can do with featured images.

    FAQs About Featured Images in WordPress

    As a beginner, you may come across questions or issues when using featured images on your blog. Following are just some of the most frequently asked questions about featured images.

    1. Why featured image is appearing twice on my posts?

    Sometimes beginner add a featured image and then add the same image inside the content part of the post editor.

    All you have to do is remove the image from the content area and only use featured image metabox to add featured image. For more on this topic, see our article on how to fix featured image appearing twice in WordPress.

    2. What is the difference between the cover image and featured image?

    Cover images are used in the content area of your posts or pages. They are normally used to separate different sections of a lengthy page or post.

    Featured image is the representative image of an article. It does appear before or alongside the content but not inside the actual article.

    For more on this topic, see our guide on the difference between cover image and featured image in WordPress.

    3. How to display featured images next to recent blog posts?

    The WordPress block editor comes with a ‘Latest Posts’ block which allows you to display recent posts with post thumbnails.

    You can also display recent posts with thumbnails in sidebar widgets using Recent Posts Widget Extended plugin. For more details, see our article on how to display recent posts in WordPress.

    4. How to remind authors to add featured image in WordPress?

    Featured images are prominently displayed on your homepage, blog page, and other archive pages.

    If you or another author on your blog forgot to set one and published the post then it will appear without a featured image. This will look bad and inconsistent, which is not good for user experience.

    You can install and activate the Require Featured Image plugin, which will show a notification when anyone tries to publish a post without featured image.

    Require featured image

    For more details, see our article on how to require featured images in WordPress.

    We hope that this article helped you learn how to add featured images or post thumbnails in WordPress. You may also want to check out our beginner’s guide to image SEO which shows how to optimize your WordPress images for search engines.

    If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit – a collection of WordPress related products and resources that every professional should have!

Reader Interactions

119 CommentsLeave a Reply

  1. What do I need to do to only have the featured image shown next to each post in the blog roll, but not when you are reading individual posts? Do I insert the line of code into my index.php file or is there something else? Thanks!

  2. Hi,
    is it possible to embed a code as a featured image? For example: Getty images offers free pictures for bloggers. Once i copy the code its easy to embed in the post, but I need the pictures as my featured image. Is there a way I can do this? Plugin?
    Thanks for your help!

  3. I cant find the featured pictures bit on this and can you use this for hp windows laptop?????

  4. I want to remove blank space of featured image from wordpress post. Can you please help me.

  5. Need help with distorted pics on mobile look of site. When you click read more the photos are distorted can someone explain what i need to do. thanks

  6. Hi,

    Thanks for the info. I’ve been following this blog and help a lot.

    I have a question regarding the thumbnail.

    1. It is possible the thumbnail or featured image appeared on the blog roll but when the user click and open the entire post, the feature image will be hide?

    2. Or it is possible that one of the image inside the post will be use as the featured image?

    The reason for this is, in my blog not all post have image on the beginning of the post. When I set featured image, it will automatically insert on the beginning of the post.

    Thanks.

  7. Hi, I am able to upload a feature image successfully but when I open the post, the image doesn’t show. What might be the problem? For better understanding you can check out my post below to get what I mean. I use the plugin WP Smush as well so not sure if this affects.

  8. I’d been using Timthumb for a while now, and I was kinda afraid to change to WordPress’ built in featured images, but this tutorial worked perfectly – and Worpress is handling different sized images just fine! So thank you so much for it!
    Cheers!

  9. Thanks for the article, really helped me out today, I now have pictures on my blog roll.
    Cheers Tracy

  10. Thanks for making it so simple! I was petrified of going into the code, but with your help I finally fixed the thing that has been bugging me for days!

    Thank you!

  11. I have set a Featured Image for most of my blog posts. (In each case the image is already present within the post.) My Reading setting is set to show the latest post when viewing the Home page.

    However, on the Home page the Featured image is repeated above the post, and I don’t want that. How can I prevent that duplication?

    I’m not getting any response from the WP Support Forum.

    • I have the same issue as Barry.
      So I remove the original, and try to remember to set FI first.. it’s sort of ok.
      But when hover over image I don’t get the title info (Firefox) that is there.. ???

  12. Hello,

    I’m not sure if this fits under the “featured image” issue, but I am hoping to use a image link map on the featured image (my client insist on having it), but I cannot seem to find where I can edit the code easily. The theme they have selected is utilizing a left side bar as the regular “header” so I’ve had to set a featured image to be the “header” on each post. I don’t want to start messing around with the .php or stylesheet until I know whether or not I can actually do it, or more insight on how to do it.

  13. Help!! Our website crashed and it’s been rebuilt but now there is a problem with featured image. The images are cutting off the top of the pictures, such as peoples heads. Also, when setting featured images, pictures are not uploading to featured image size and they are loading in the centre, not to the left.
    Hope this makes sense. I have tried everything I can think of, unsure about changing coding in php as previous effort crashed site. Any help greatly received.

  14. Hi there,
    Great tutorial indeed. Especially, the links you provided at the end of this tutorial are awesome.
    Customizing a WordPress website is always a charm.

    • That all depends on the theme you are using. :) It’s all about the styling. Some themes have functionality to allow you to choose the layout of your blog and change the sizing, but many don’t. If your theme is one that doesn’t, you will have to make the change in your styles.css file. If it DOES, it will be somewhere in your theme options area. Good luck! :)

  15. It doesnt appear on my post editor. appears the one from the theme but does not work! any solution? thanks a lot

  16. Hi, i’ve tried to add the code to my functions.php. This is what was the “response”: Warning: Cannot modify header information – headers already sent by (output started at
    Please help!

  17. Thanks for detailed post about adding Thumbnail and Featured Image.

    For my website, I display recent post in Sidebar and Related post at end of every post.

    Is there any way that I can have different Thumbnail image for Sidebar and Featured Post at the end of the Page, for same post?

    Basically, I want to have 2 featured images for single post. Thanks.

  18. this snipet works.

    but how can i create a custom page where i can place this snippet as the body?

    • ive created a php file with this script:
    (get_header) (body: this script) + (get_footer)

    •i uploaded this file into my themes folder and made it as a Template for pages.

    • now im creating a new page. and seting it to load the template i created.

    • the output is blank. its only showing the (header) (emptybody) (footer)

    Should i replace the code in “content-single.php” with this script. so that the Rule of “loading the feature image” is applied everywhere?

  19. My wordpress theme is wildfire and the featured image size and post featured thumbnail size are different. But on the slider, the featured image is not showing up properly and appears to be blown out of proportion. How can I make sure that when I upload the featured image, it displays correctly in slider and also in the post featured thumbnail according to the respective sizes.

  20. Hi,

    I have tried putting this code into my functions file in lots of different spots (top, bottom, middle, etc) and it still doesn’t seem to work.

    Can you suggest any other kinds of troubleshooting? I really want to be able to do excerpts with featured images, which I know is supposed to be a function of the theme I am using.

    Help! This stuff makes me (a non-techie) go crazy!! Thank you :)

  21. I start a wordPress Theme Customization, I use featured image various post in my theme,In a page “contact Us” I want to add image. I can add statically image under a div in this page.But i wan to add featured image in this div / In this section,Which will work dynamically.Now how can i call this featured image in this div………..?????????

  22. I have a question – where exactly within the functions.php file should the snippet “add_theme_support( ‘post-thumbnails’ );” be added?

  23. Good afternoon,

    I am using the ClassiPress theme and would like to announce that when the person on the site, automatically announcement appeared on facebook.
    I am using the plugin “Facebook Auto Publish” and it works well but does not put the photo.

    How can I make the images of the ads, only the first is great, appear on facebook?

    thank you!

  24. Tnx for the article.

    I have a problem here, since if I click “New Post”, there is not Featured Image option. It appears only if I click edit on an allready published post.
    But the problem is, that once it is published, it is allready been posted to my FB, and if I edit it then, it wont get updated on FB.

    Any solution?

    • Click on New Post, when the post editor opens, click on “Screen Options” link on the top right corner of the screen. This will open a fly-down menu. You will see a checkbox next to featured images. Make sure Featured images is checked.

      Admin

  25. i using “transcript wordpress theme” and i’m having difficulties having thumbnails on home page, you can only see pics when u click on a post. i have installed “regenerate thumbnail” plugin and regenerated the thumbnails and it didn’t work… Pls help…

  26. Hi, I used the featured images option. However in my blog roll, the image is on top of the excerpt. I want the excerpt to be to the side of the featured image. How do i do this?
    Thanks

  27. I wouldn’t have done lots of things if wpbeginner hadn’t existed !!
    I am really thankful :)

    • Guys, I used this add on: add_theme_support( ‘post-thumbnails’ ); and I ended up messing up the entire site. I don’t have a way to get back to it to delete. Help please!!!

      • Karol, you can edit it by using an FTP client, like Filezilla. Connect to your website using FTP locate the file /wp-content/themes/your-theme-name/functions.php right click and select Edit to open this file in a text editor. Find the lines you added and remove them.

        Admin

  28. I have been having issues with trying to remove a featured image. When I click on the ‘remove featured image’ link in the post – nothing happens. Have you come across this before? Its causing us to have to recreate posts when we want to add a new featured image :(

    • It is possible that a WordPress plugin is causing the problem. Try deactivating your plugins one by one, after deactivating each plugin go back to a post and try to remove a featured image. Repeat this until you find the plugin causing the problem. Let us know if this resolves the issue.

      Admin

  29. I have been using wordpress theme for my website over a month. All of a sudden now when I am uploading featured image, it is uploading but the image dimensions are not displayed in the thumbnail which shows up in Media Library, this means the post will not display the featured image. And when I click “Edit Image” next to the thumbnail, I get an error message “Image data does not exist. Please re-upload the image.” I am really frustrated because of this error, I am nto able to post new articles as I am not able to upload new images, already uploaded images works. I have searched a lot and have done all troubleshooting. Is have already contacted theme support, they are telling, its hosting issue and they should be able to resolve. I am not sure what is causing this issue. I have already emailed them and waiting for reply. Any idea why this is happening, it was working fine till now.

    Thanks any suggestions will be very much helpful.

  30. Is there a way to bulk remove featured image from multiple posts? Currently the way to unset featured image is to remove it via the post edit page individually.

  31. Hi, on my food blog http://www.reallifedinner I have been trying to figure out how to have the featured image show up in my category archives (like my recipe index) with out having them show up in the top corner of each post. I have turned off the display right now because it looks so stupid to have the tiny thumbnail above the larger post image. Can you help me? Is there a way I can get the one on the post to disappear without getting rid of the one in the archives?

    • You need to create a new image size for example category-archive-thumbnail. Then you need to use in your category templates. Also make sure that you not inserting the featured image inside your individual posts. You just need to set the featured image and let your theme handle the display of featured image on single post view and category archives.

      Admin

  32. Hi

    I have a problem which I cannot solve and still googling on this topic and hope you can advise.

    I have around 5000 custom posts, all I want to do is assign X amount of posts to a featured image, i.e. bulk assign featured image to X amount of posts.

    Can you please help me?

  33. i enterd the code above and it crashed my website – white screen of death – now i can;t get in anywhere. .. i read your page on how to fix the white screen, butnone of it worked… i just need to get into the editor theme and remove your code that i entered – any idea how to do that>?

    • you can use an FTP client like Filezilla to access your site. Then go to the file you last edited. Download that file and open it in a text editor like notepad or WordPad. Remove the lines you last edited and upload the file back using FTP.

      Admin

  34. Suddenly I can’t post images in blog. Here is what is happening:
    New Post>Add Media>Now Im at the Insert Media but it only lets my use the Upload option, the Media Library option is dead.>SO ok I’ll upload the image, it looks like it uploads, and then I get a Error Message that says, ” Error _DSC6096WEB.jpg An error occurred in the upload. Please try again later. ”
    So now I can’t insert an image in my post. However, If I hit the back arrow to my Dashboard and click on MEDIA>Library the image that had the error is there! So then I click the small box next to the image and hit view. and it shows it on my blog page as a tiny image, now I either go back OR I have the option to EDIT, I see the image but it won’t let me post the image, I have a choice of UPDATE or DELETE PERMENETLY.

    Im going in circles, any suggestions?

  35. We’re having an issue that maybe you can help me with?
    – We add a blog post without an image
    – We check the homepage- looks fine
    – Then later we notice that an image has been randomly attached to the post
    Do you have any idea what’s causing this?
    thanks!

    • Also, i should say that it’s happing on the live site but we can’t seem to replicate it on the staging site which is why we suspect is has something to do with servers but not sure how to solve the problem.

      • Seems odd. If a post is being randomly attached, then it can happen because of another plugin that maybe checks for the featured image if nothing found attaches the first image of the post as featured image.

        Admin

  36. when using featured images, it creates the thumbnail successfully, but also posts the larger ‘featured image’ above the posts, how do you remove this double post?

    i want my post excerpt to have a thumbnail, 200 words and a ‘read more’ button ….
    i want my full post to have the full sized photo and all the text

    why is this so hard? what am i missing? why are thumbnails tied to featured (above the fold) images??

      • wordpress 2012 theme is what i’m using. only minor cosmetic changes to it. nothing structural.

        any ideas? i could really use some help!

        thanks very much for your response! appreciate it!

        • Justin, did you ever fix this? The exact same thing is happening to me. I want to move to a responsive them (awethemes reactor) which adds the thumb on the posts/blog page AND in the post. Been chasing my tail on this for hours!

        • @Justin and Martin:

          Twenty Twelve displays featured image above the post content. You are not supposed to insert a featured image inside the post. You just need to set it as featured image. A lot of users make this mistake and not only they set the featured image they also insert it into the post. This way the image appears twice on the site in different sizes. Once as featured image and once as part of the post content.

          A featured image does not necessarily have to be a thumbnail or a smaller size. For example, twenty twelve and twenty thirteen display large images as featured images by default.

          So what you need to do is to create a new image size. Then remove the tag <?php the_post_thumbnail(); ?> and use <?php the_post_thumbnail(‘your-thumbnail-size’); ?> where ever your want the thumbnail to appear.

          Hope this resolves the issue you guys are having.

  37. Glad to see another good article on use of coding rather than blindly using a plugin. Keep up the great work.

  38. Featured images only work going foward. If you haven’t set a featured image, it won’t show up.

    So is there a way to retrospectively set a featured image in bulk for each post (i.e. pick the first image in the post); without having to do it manually?

Leave a Reply to Josh Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.