WordPress Images

The Media Library Nobody Cleans: A Practical Guide to Image Bloat

Four separate problems, usually mistaken for one big one.

Oversized originals, files nothing links to, duplicates and images with no information attached. Different problems, different risks, and a safe order to tackle them in.

A media library manager with folders, tags and smart folders

Every WordPress site over about two years old has the same room in it: a media library nobody has opened on purpose since the theme was installed. Thousands of files, a third of them unused, most of them larger than they need to be, all of them named things like IMG_4471 and screenshot-2.

It is not a crisis. It is more like a garage. But it quietly costs you backup time, storage, page weight and, on the day you finally want to reuse an old photograph, about twenty minutes of scrolling.

What is actually in there

Before deleting anything, it helps to know what the library is made of, because most of it is not what people assume.

When you upload one photograph, WordPress does not store one file. It stores the original plus a set of resized copies: thumbnail, medium, large, and whatever additional sizes your theme and plugins have registered. A site with a page builder and a shop plugin can easily have eight or nine registered sizes, which means one upload becomes ten files on disk.

This is mostly good. Those copies are what let the browser download a small picture on a phone instead of a large one. But it means two things: the size of your uploads folder is not the size of your images, and deleting things has consequences you should understand before you start.

The four piles

Sorting a library is easier when you stop thinking of it as one problem. There are four separate ones.

1. Originals that are far too big

A modern phone produces images around 4000 pixels wide. A website almost never displays anything above 2000. Every one of those originals is sitting in your uploads folder at full resolution, and every backup copies them again.

This is the biggest single win and the least risky. Re-encoding the originals down to a sensible maximum, say 2560 pixels on the long edge, typically cuts the folder by half or more, and nothing on the site looks different, because the site was never showing the original anyway.

2. Files nothing links to

Images uploaded for a post that was rewritten, a header that was replaced, a product that was deleted. They are invisible and harmless, but they are also the reason your library has four thousand entries instead of nine hundred.

Be careful here. “Unused” is genuinely hard to determine, because an image can be referenced from a page builder’s serialised data, a widget, a custom field, a CSS file or a theme option, and a naive check will miss all of those and cheerfully tell you a live logo is unused. Use a tool that scans post content, meta and options, review the list rather than trusting it, and take a backup first. Every time.

A media library manager with folders, tags and smart folders
Smart folders that collect everything missing alt text, or everything nothing links to, turn a vague clean-up into a finite list.

3. Duplicates

The same picture uploaded three times because three people needed it, usually under three different names. Duplicates are worth finding not mainly for the storage but because they fragment your library: you can never remember which copy is the good one.

4. Files with no information attached

No title worth reading, no alt text, no caption. This is the pile that costs you the most and looks like it costs nothing, because it is the reason nobody can find anything. More on that below.

Do the safe things first

There is a natural order, from lowest risk to highest.

  1. Back up. Files and database. Not negotiable, because the next four steps all delete or overwrite something.
  2. Regenerate and shrink the originals. Nothing is deleted, the site is unchanged, the folder gets dramatically smaller.
  3. Convert to a modern format where your setup supports it, keeping the originals until you have looked at a sample.
  4. Add the missing metadata, which is additive and cannot break anything.
  5. Then, and only then, delete. Start with obvious duplicates, then the unused list, in batches, checking the site between batches.

Naming, so that this never happens again

The reason the library is unsearchable is that filenames carry no meaning. IMG_4471 tells you nothing, and neither does screenshot-2, and once there are two thousand of them the only search that works is scrolling.

A filename convention costs nothing and pays forever. Something like subject-context-variant.jpg: walnut-desk-side-angle.jpg, team-portrait-anna-2026.jpg. Lowercase, hyphens rather than spaces or underscores, no dates unless the date is genuinely part of the identity.

As a bonus, the filename is a small ranking signal for image search, and it is what appears if the image ever fails to load. But the real reason is the one that shows up two years later, when you type “walnut” into the search box and find the picture in four seconds.

Folders and tags are not the same thing

WordPress has no native folders for media, which is why so many plugins add them. Folders are good for the question “where does this belong”, and they have one hard limitation: a file lives in exactly one of them.

Tags answer a different question: “what is this about”. A photograph can be tagged product, autumn and outdoor at once, and turn up in all three searches. Most libraries want both: a small number of folders reflecting how work arrives, and a generous number of tags reflecting how work is looked for.

Keep the folder count low. A hierarchy nobody can hold in their head gets abandoned within a month, and then you have two systems, which is worse than none.

A metadata assistant filling in titles, alt text, captions and tags
Filling in a thousand descriptions by hand is why nobody ever does it. Generating a first draft and then correcting it is a different job entirely.

The part that actually pays off

If you only do one thing, do the descriptions. A library where every image has a real title, alt text and a few tags stops being a pile and becomes a searchable archive. That changes behavior: people reuse the picture that exists instead of uploading a new copy, which is what caused half the mess in the first place.

Doing it by hand for an existing library is unrealistic, which is exactly why it never gets done. Generating a first pass automatically and then correcting the ones that matter is realistic, and an hour of correcting beats a week of typing.

Then keep it that way

A clean library drifts back within a year unless something holds the line. Three habits do most of the work: resize before uploading rather than after, name the file before it leaves your computer, and write the alt text at the moment you insert the image, when you still remember what it is.

None of that is interesting. All of it is cheaper than doing this again.

Table of Contents

Learn it by building something

Every week one thing you can make the same afternoon, from dynamic templates to 3D type. Written down step by step.

One mail a week, and then it ends.
Unsubscribe in one click.

Free

Chaos Art

Autonomous painters make one-of-a-kind abstract art in 3D space - gestures, art movements, painterly media, and embeds that paint a new original for every visitor.

Download the free WunderPaint Plugin for WordPress

The Image Editor & Design Studio

Everything described here can be done in the browser, on your own site. The live demo runs the full editor with nothing to install.

Design Tools

Brush & Paint Styles

Paint with six styles that mix pigment instead of blending it, pick from thirty-seven tips shown as real strokes, draw a tip of your own out of shapes, and let the color travel along the stroke.

Workflow & Automation

Dynamic Templates: Build the Design Once, Let Your Posts Fill It In

You build the layout once, tell a few layers where to get their content, and from then on every post, product or page renders its own version.

Print & Craft

Making Things That Fold: Dielines, Duplex and Why Previews Matter

A gift box, a paper crane, a bunting banner. They look simple, and they fail in ways flat design never does, because there is a second geometry underneath.

WordPress Images

Why Should a Design Become a File at All?

Every static graphic on a page is a snapshot of what was true when somebody exported it. There is a whole category of quiet wrongness that follows from that.