Reduce Image Bloat in WordPress And Get Rid Of Unused Files

Too many image files WordPressIf you use a lot of photos and graphics on your WordPress site, you’ve probably accumulated a tonne of image files on your server that you have no use for. This is a quick and effective strategy for cutting down on excess image files and only keeping what you actually need.

The image bloat problem

When you upload a photo or graphic to your site, by default WordPress creates four different sizes of the image: Thumbnail, Medium, Large and Full Size.

Multiple image sizes WordPress

In all likelihood, you’re only going to use one of these image sizes. But you’ve now got four or five separate files taking up space on your server.

Delete unused images files in WordPress

These junk image files will accumulate at an exponential rate, and over time can really start hogging valuable storage space. Unless you have an explicit reason to keep certain files, you’re better of deleting them and keeping your WordPress house clean and tidy.

If you don’t want to trawl through your server and delete all of these images files manually, you could check out the Additional Image Sizes plugin.

Featured Plugin - WordPress Infinite SEO Plugin

Fully integrated with the SEOMoz API, complete with automatic links, sitemaps and SEO optimization of your WordPress setup - this is the only plugin you need to help you rank your site number 1 on Google - nothing else compares.
Find out more

The image bloat solution

Once you’ve cleared out all those unused image files from your server, this a quick and painless solution to stop WordPress from creating them in the first place.

Many thanks to Marna Friedman for this suggestion, received last week during out WordPress Q & A session.

Simply venture into the Settings > Media panel in the left of your WordPress dashboard. Here you can specify the default dimensions of each pre-defined image size: Thumbnail, Medium and Large. By changing the height and width dimensions to zero, you’re telling WordPress not to create the image file.

Get rid of image files in WordPress

And that’s all there is to it.

Note: if you’re going to do this, it’s important that you have the correct size image when you initially upload it. If you only use one image size throughout all your posts and pages, you could consider plugging your desired dimensions into the ‘large’ or ‘medium’ image size, and getting rid of the other two.

This will save you the trouble of resizing images before you upload them, but you’ll be left with one extra image file on your server every time.

Featured Plugin - WordPress Newsletter Plugin

Now there's no need to pay for a third party service to sign up, manage and send beautiful email newsletters to your subscriber base - this plugin has got the lot.
Find out more

Image credit:Folder from Bigstockphoto.

Comments (11)

  1. I like this idea! I size my images in Photoshop before uploading them to the WordPress image library. If I change all the image sizes to zero, how will that affect the image that I’ve actually placed on my blog post?

  2. I think you should stress in your article that this “method” will only work for sites that use one image size only. Also if you use this “method” you will immediately notice that your media library won’t show the tumbs correct anymore for the simple reason that you have deleted the thumb “because you didn’t need it” (orso you thought).

    Let’s say that I build a site for someone with featured images and lots of other different image sizes, using your instructions the site will not look the same anymore. Although I do agree that some of the image sizes can lead to bloat, you cannot just delete the whole lot.

    • As always, it depends on the kind of site you’re running and what you’re actually doing with the images. This isn’t blanket advice that applies to every WordPress user, but rather a tip for people who only use one size of their images and don’t have any need for the others.

      Thanks for the comment!


  3. Useful, but it doesn’t solve the bloat problem for any existing blogs with tons of images, only new ones going forward.

    There seems to be no well done solution for blogs that have been around for 2 years, posting 3MB picture files every week, and now have a 900MB WordPress install. I’ve run into this with my clients lately, there’s a few shotty plugins out there (DUI) but nothing solid!