Your uploads folder is huge: images and disk usage

On most WordPress sites the uploads folder is the largest thing on the account, and it grows in ways people do not expect.

Why it is bigger than you think

WordPress does not store one copy of each image. It creates several sizes of every upload – thumbnail, medium, large, and whatever sizes your theme and plugins register. A theme with six custom sizes means seven files for every image you add. Upload a 6MB photo straight from a camera and you may be storing 15MB across all its versions.

What to do

  • Resize before uploading. Very few sites display an image wider than about 2000 pixels. Nothing is gained by uploading at 6000.
  • Compress. A compression plugin will typically reclaim a large fraction of the space with no visible difference.
  • Remove sizes you do not use. If your theme registers sizes nothing displays, they are pure waste.
  • Clean up orphans. Deleting a post does not delete its images. Sites years old accumulate a great deal of unreferenced media.

The inode angle

This is not only about disk space. Every one of those generated files is an inode, and inode limits are usually reached long before disk limits. Ten thousand images with seven sizes each is seventy thousand files. See Why you have run out of inodes.

Before deleting anything

Take a backup. Media cleanup plugins decide what is unused by scanning for references, and they cannot see images referenced only inside a page builder's stored layout or in custom code – so they occasionally remove something that was in use.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Why WP-Cron is disabled on our servers, and what replaces it

WordPress has its own scheduling system, WP-Cron, which runs scheduled tasks – publishing...

Object caching, and why Redis is not available here

WordPress can store the results of database queries in memory so that repeated requests do not...

Moving an existing WordPress site to us

A move goes wrong in predictable ways. Doing it in this order avoids all of them. 1. Set the...

The white screen of death: how to diagnose it

A completely blank page means PHP stopped part-way through and had nothing to show. The page...

Locked out of wp-admin: how to get back in

There are several routes back in depending on what is wrong. All of them need cPanel access, so...