Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
WordPress Plugins
View all Guides

How to Add Featured Images or Post Thumbnails in WordPress

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
How to Add Featured Images or Post Thumbnails in WordPress

Featured images also known as post thumbnails are a popular feature in WordPress themes. Today most WordPress photography themes, restaurant themes, church themes, and other types of themes have built-in support for post thumbnails. In this article we will show you how to add featured images or post thumbnails in WordPress.

You might be thinking why are we using featured image and post thumbnail interchangeably. Well, when this feature was first introduced in WordPress 2.9, it was called post thumbnails. However, in the next version it was renamed to featured image.

Beginners Guide to Featured Images in WordPress

Featured Images or Post Thumbnails is a theme feature. Most themes such as Genesis and others support featured images by default.

An easy way to figure out whether your theme supports featured images is by going to the post editor. Simply create a new post and scroll down a little to see if there is a meta box called featured images on the right hand side of the screen.

Featured image metabox in WordPress

Adding Post Thumbnail or Featured Image in WordPress

To add a featured image in a WordPress post, simply click on “Set Featured Image” link inside the featured image meta box shown in the screenshot above.

This will open the WordPress Media Uploader. You can use that to upload an image from your computer or use an existing image from your media library. Once you select the image, simply click on Set Featured Image button.

Setting a featured image in WordPress

The image will appear in the Featured Image meta box, like this:

A featured image added in a WordPress post

It is important to note that the image may appear a little bit differently in your theme. It all depends on how your theme handles featured images.

Some magazine themes use smaller thumbnails along side post summaries on the main page, and a larger version on the single post view.

Depending on settings defined by your theme developer, your featured image will automatically appear with your posts. However, if you want to change the way your theme handles featured images and post thumbnails then continue reading.

Note: Everything below this will require coding knowledge.

Theme Developers Guide to Featured Image and Post Thumbnails in WordPress

Even though featured image is a popular feature supported by a large number of themes, it is still possible that you might be using a theme that does not support featured images. In that case, you can add featured image support to your theme. If you are comfortable editing theme files and know your way around a little CSS, then you can do it yourself.

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 pages, and you will see 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.

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 in 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 a specific image size.

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

This is broken down version of the full functionality. You can further extend the functionality of featured images. For example, you can set a default fallback image for post thumbnails, display featured images with captions, or even add multiple post thumbnails or featured images.

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 list of 14 best featured images plugins and tutorials for WordPress.

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.

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »


  1. lauren lynch says:

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

  2. Sumit Kumar Gogawat says:

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

  3. carlita says:

    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

  4. Adam says:

    How do I edit a post so that the picture is beside a blog post description?

  5. Harini says:

    I do not know how to convert html file to wordpress. As a beginner can you help me.

  6. Astha says:

    thanks :)

  7. Abs says:


    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.


  8. Isabel says:

    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.

  9. Gaby says:

    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!

  10. Tracy Quinn says:

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

  11. Filip says:

    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!

  12. Barry Richardson says:

    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.

    • bobbi says:

      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.. ???

  13. Milagros Cuevas says:


    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.

  14. Anne Seabrook says:

    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.

  15. Lionel says:

    Thanks for this tip, that’s exactly what I need ! :)

  16. Daniel Keith says:

    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.

  17. Chao says:

    How to display featured image below page title?

  18. Maiya says:

    How do I make the thumbnails of my featured images bigger?

    • Dinnae says:

      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! :)

  19. jay says:

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

  20. WPBeginner Staff says:

    Please make sure that there is no space after the last command at the end of your functions.php file. Alternately, you can also create a site-specific plugin and paste your code there.

  21. Ratio says:

    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!

  22. Mohsin Alam says:

    Another great help! I’ve got rid of thumbnail issue. You are rocks my brother Syed.

  23. kumarapush says:

    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.

  24. imagecolor says:

    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?

  25. Saurabh Mathur says:

    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.

  26. Gemma says:


    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 :)

  27. Sajjadur Rahman says:

    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………..?????????

  28. Pat MacDonald says:

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

  29. luis says:

    this was really nice and clear! Thanks!!! =)

  30. Flávio Cecilio says:

    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!

  31. Bojan says:

    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?

    • WPBeginner Support says:

      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.

  32. Nate Otaba says:

    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…

  33. Nalin says:

    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?

  34. Alexandros Gr says:

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

    • Karol says:

      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!!!

      • WPBeginner Support says:

        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.

  35. Darlene Burke says:

    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 :(

    • WPBeginner Support says:

      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.

  36. Nishanth says:

    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.

  37. TY says:

    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.

  38. Maria says:

    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?

    • WPBeginner Support says:

      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.

  39. PaulJoe says:

    This article helped me a lot in adding images to my WordPress blog. thank you so much

  40. Nathmie says:


    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?

  41. kyle says:

    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>?

    • WPBeginner Support says:

      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.

  42. Nancy ZIller says:

    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?

  43. Chloe says:

    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?

    • Chloe says:

      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.

      • Editorial Staff says:

        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.

  44. justin says:

    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??

    • Editorial Staff says:

      It sounds like an issue with your theme.

      • justin says:

        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!

        • Martin says:

          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!

        • WPBeginner Support says:

          @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.

  45. Aiza Khan says:

    I have a problem with my wordpress blog that the images urls are appearing like this

    After the .jpg why this ?487874 is appearing. Due to this my images are not indexing in google.

  46. Nathan says:

    That helped a lot. The coding stuff is just too complicated for me.

  47. Mark says:

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

  48. Silvan says:

    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?

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.