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 Prevent WordPress from Generating Image Sizes

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
How to Prevent WordPress from Generating Image Sizes

By default, WordPress generates three sizes of each image that you upload. Themes and plugins can generate additional image sizes which can easily push the number between 5 – 10. If you have a lot of image based content on your site, then after a while this may increase your storage needs and backup file size. In this article, we will show you how to prevent WordPress from generating image sizes.

Why and When You Need to Prevent WordPress From Generating Image Sizes

First thing you should keep in mind is that the default image sizes are not harmful for your website. Most WordPress hosting providers offer generous disk space enough to store thousands of images.

The additional image sizes are generated and stored during the upload process, so they do not affect website visitors in any way. If you are having trouble with handling images or post thumbnails, then instead of switching them off you can learn how to solve some common image issues.

Having said that, some users may want to prevent WordPress from generating image sizes. For example, if you have thousands of images, then the copies of these images could make your backup sizes extremely large. It would also become time consuming for your backup plugin to prepare and store backups to the cloud. Lastly, if you don’t see yourself using some of the available image sizes, then disabling them will save you space.

Stopping WordPress From Generating Image Copies in Different Sizes

First you need to understand how many copies of an uploaded image are generated by WordPress. By default WordPress generates three image sizes, for thumbnail, medium, and large. Apart from these image sizes, your WordPress theme may also have its own image sizes for featured image/post thumbnails, sliders, and other features.

You need to connect to your website using an FTP client to find out how many copies of an image your WordPress site is generating.

Start by uploading an image to your site from your WordPress admin area. Next, connect to your website using an FTP client, or use cPanel’s file manager. Now go to /wp-content/uploads/ directory. The image file you upload are stored in year and month based directory. Once you are in the directory, you will see all images generated by WordPress.

Images stored for different image sizes in WordPress

As you can see in the screenshot above, our demo WordPress installation is generating 5 copies of each image. Three of these images are the default WordPress image sizes thumbnail, medium, and large. Other two sizes are generated by the theme.

You can stop WordPress from generating default image sizes by visiting Settings » Media in WordPress admin area. There you will see default image sizes predefined by WordPress. You need to set these sizes to 0 which will prevent WordPress from generating default image sizes when you upload a new image.

Setting the default image sizes to zero in WordPress

Note: WordPress uses the thumbnail image size for galleries, so if you set that to 0, then your future gallery display may not work properly.

The other two image sizes are generated by the WordPress theme. You can usually find the theme size code in your theme’s functions.php file. Simply look for the code line containing add_image_size function. It will look something like this, and there could be multiple lines depending on how many image sizes your theme supports:

add_image_size( 'homepage-thumb', 220, 180, true ); 

Removing these lines will stop your theme from generating those image sizes.

You also need to find the line containing set_post_thumbnail_size function. It will look something like this:

set_post_thumbnail_size( 150, 150 );

Removing this line will stop your theme from generating post thumbnail size in WordPress.

Please note that these image sizes may be used by your theme for post thumbnails, sliders, attachments, or custom post types. Only remove them if you are certain and well aware of the effect this might have on your site.

We hope this article helped you prevent WordPress from generating image sizes and keep your uploads directory clutter free. For feedback and questions, you can leave a comment below, or join us on Twitter and Google+.

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. Xuan hoa says:

    And i dont want save original image, how i can do it ? thanks

  2. Steve Woods says:

    I am using Suffusion theme and beside the three native sizes of 200×200, 300×225, 400×300, I am also getting 96×96, 128×128, 128×72 and 480×360. That’s seven sizes!

    The problem is that all these different sizes may be seen by Google as duplication. That seems to hold water because only a small fraction of my images are being indexed.

    Is there a setting I am missing or plugin that can fix and clean this mess up?


    • WPBeginner Support says:

      We feel that Google understands that your site may host several smaller or larger versions of an image. It is not duplicate content.

  3. Duncan says:

    I want to be able to click on an image in my blog to open it as an enlarged version in a separate pop-up window. How?

  4. Amit Kr Sharma says:

    i have a running image sharing website , usually we insert more then 20 images in a single post. I want to prevent WordPress from generating different image sizes for inserted images, except for the post featured image.

    For example If there’s 20 images in my post. I want WP to generate image sizes for the Featured image only, and for other inserted images i don’t want different sizes.
    Actually the problem is the limited storage space and the other problem is that with those useless image sizes the backup file has more size.

    How can I achieve this ?
    I appreciate your help.

  5. Jefferson says:

    It helped me a lot! Thank you very much!

  6. ITWEBMOB says:

    But still one major issue , Stop use thumbnail native image
    I want Use cache image thumbnail inserted of native image, its create junk on web-space
    e.g If I upload one product its make 3-6 thumbnail image from original picture.

    How can I use Cache images system e.g. megento, prestashop, opencart with easy one click all cache clear option

    note: use spl folder location for store cache images not wp-content/2015/12/

  7. pavlo says:

    Very helpful article, I found what generates 88×88 thumbnails in functions.php of my theme! thanks a lot!

  8. Marius says:

    Thanks for the article. More than a year later it’s still useful! I just managed to change my theme to stop creating potentially thousands of variants of images I intend to have in WordPress galleries. However, what I did was
    (1) to comment out the add_image_size( ‘square100’, 100, 100, true ) as suggested, and
    (2) to replace the parameters to the_post_thumbnail call (see WP Codex) with an array e g
    the_post_thumbnail(‘square100’) became the_post_thumbnail( array(100,100)).
    This stopped the unnecessary creation of variants for every image loaded.
    To do this I had to override various functions and files in the theme by using a child theme, which is a whole subject on its own, and not to be attempted if you don’t have good knowledge of how child themes work!

  9. Nicolas says:

    Hi do you happen to know how to unregister

    While removing the line works i wouldn’t like to modify the theme and unregister on my child theme, so i don’t have to remember to do it again every time the theme updates.

    Thank you.

  10. Jay says:

    I just read this and my theme and wordpress combined is generating 25 copies of each photo! I use a lot of photos on my site, the big question is how do we know which ones we can erase, i think three sizes is more then enough, but 25 sizes!

    Any thoughts WPBeginner!

  11. subhojti says:

    thank you

  12. Jens Brogaard says:

    Hi there, I think you’ve overlooked a way to decrease the number of generated image sizes;
    First, as you mention, get an overview of image settings in WP, theme and perhaps plugins – jot them down, px by px.
    Secondly, decide what is needed according to your visual needs. Often there’s small differences in e.g. thumbnail size but you can do with just one global size.
    Then lastly, align as much as possible, i.e. keep all the image settings but try to set as few variations as possible.
    I’n not in favor of messing around with the code since too often something will break down the road but this is just good practice of knowing what you want ;)

    • Mitchell says:

      Jens, would you mind private messaging me? I’m having a heck of time trying to reduce the amount of images on my site. My host is going to shut it down.

      Much appreciated!

  13. greg taylor says:

    Is there a computer–mac- windows-or chrome book, etc that lends itself to easier/better writing a wp blog—.com, not org? any overall ease of use for a newbie, like me?
    any thoughts on above appreciated.—greg —ww2–disabled vet

  14. Christian Zumbrunnen says:

    There is a plugin called “Regenarete Thumbnails” (and another one “Force Regenerate Thumbnails”) which will resize existing images according to the new configuration. At least the second one promises to also delete the old resized images.

  15. Himanshu Goel says:

    I want to keep the thumbnails and rest I want to ignore, so, I will change only other 2 options than Thumbnail and If this will work…

    Really, That will be helpful guys…!

  16. Christian says:

    Thanks for the interesting article !

    You mention the “uploads” folder but there is also the: /wp-content/uploads/et_temp folder which in my case is also full of copies of images. Can you shed some light on the purpose of this particular folder. I am using a “Elegant Theme” called Envisioned.

    Thanks & Cheers,


    • WPBeginner Support says:

      Seems like your theme or may be a plugin is responsible for adding images into this folder. Unfortunately, we can not specifically provide help with individual theme and plugin settings. You will need to contact your theme or plugin support and ask them how you can prevent this.

  17. Mike says:

    FANTASTIC article. Now I just need to figure out how to delete the unneeded images that have already been generated, without deleting the ones I need.

  18. sachin says:

    thank you so much for posting this. i have very tensed about disk space and inodes now i can feel some relief thank you very much….

  19. Karen H. says:

    Thanks for another useful article. I’m just wondering whether removing the various image sizes would have an adverse effect on mobile/responsive WP sites. Don’t we need those sizes so the images can adjust to various screen sizes and orientations?

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.