This guide shows you how to clean up a WordPress media library that has quietly grown out of control: removing images you no longer use, cutting the pile of resized copies WordPress and your theme generate for every upload, and in doing so reclaiming disk space and making your backups smaller and quicker. The media library is the collection of everything you have uploaded, and behind the scenes each of those uploads is stored not as one file but as several. Over a few years, that folder often becomes the single largest thing on your hosting account, which is why a tidy-up pays off in real, measurable ways. This article is written for Noiz clients who run their own WordPress site. It names categories of tool, and mentions specific plugins only as examples of a category, never as recommendations, because the right approach depends on how your site was built.
Last reviewed: 27 July 2026, against WordPress 7.0.2 (latest stable). This guide is written for Noiz hosting and is kept current against WordPress. It complements, and does not replace, the official WordPress documentation linked below.
Official Documentation Reference
- Media Library screen (WordPress Documentation): the full reference for the grid and list views, the media filters, and bulk deletion.
- Settings Media screen (WordPress Documentation): every option under Settings > Media, including the image size fields and the year and month upload folders.
- big_image_size_threshold (WordPress Developer Reference): the filter behind the 2560 pixel "big image" scaling and the
-scaledfiles it produces. - wp media regenerate (WP-CLI Command Reference): the command that rebuilds and cleans up thumbnails after you change your image sizes.
- Media plugins (WordPress Plugin Directory): the directory's media tag, where you can compare cleanup and optimisation plugins by last-updated date, compatibility, and active installs.
Prerequisites
- You can log in to your WordPress admin dashboard as an Administrator. Viewing, filtering, and deleting media, and changing image sizes, all need administrator rights.
- A recent, restorable backup taken immediately before you start. Deleting media is permanent, and the tools in this guide act in bulk, so a backup is not optional here. It is the one thing that lets you undo a mistake.
- Optional, for the measuring and command-line parts: access to your files over SFTP or your hosting panel's File Manager, and SSH access if you want to use WP-CLI. Managed-plan clients can ask the Noiz support team to run these steps instead.
Why Your Media Library Grows Faster Than You Think
Before deleting anything, it helps to understand where the bulk actually comes from, because the answer surprises most people and it changes how you clean up. When you upload a single image, WordPress does not store one file. It stores the original and then generates a set of smaller, resized copies so it can serve an appropriately sized image in different places without shrinking your huge original every time.
On a standard WordPress 7.0.2 install, uploading one large photo typically produces the original plus copies at the built-in sizes: a cropped thumbnail (150 by 150 pixels), a medium size (up to 300 pixels), a hidden medium_large size (768 pixels wide), and a large size (up to 1024 pixels). If the original is big enough, WordPress adds two more, at 1536 and 2048 pixels on the long edge, for high-resolution screens. That is already six or seven files from one upload.
Then two more multipliers stack on top:
- Your theme and plugins register their own extra sizes. A theme might add a "hero" size, a "blog card" size, and a "gallery thumbnail" size; a slider or portfolio plugin adds a few more. Every one of these is generated for every image you upload, whether or not that image is ever shown at that size. It is entirely normal for a single upload to become ten to fifteen files on disk on a feature-rich site.
- The original is kept even when it is never served. Since WordPress 5.3, any image whose longest side is over 2560 pixels is automatically scaled down to a 2560 pixel
-scaledcopy, and that scaled copy is what your pages use. The full-resolution original, straight off a modern phone or camera and often several megabytes, stays on the server forever even though visitors never load it. Multiply that by every photo you have ever uploaded and you have found where a lot of the space went.
This is the real story behind a bloated media library, and it means there are two separate jobs to do. One is removing images you genuinely no longer use, files and all. The other, which people usually forget, is trimming the number of resized copies made per image, so that every future upload, and optionally every past one, stops carrying sizes nothing on your site displays.
Measure First, So You Know What You Are Fixing
It is worth taking a reading before and after, both to prove the cleanup was worth it and to decide how hard to work at it. The folder to look at is wp-content/uploads, which holds every media file and all those generated sizes. On almost every WordPress site it is the single largest folder, and this matters beyond raw disk usage: every file in it is copied into every backup you take, so a bloated uploads folder makes each backup larger and slower to create and to restore. Trimming it is one of the most effective ways to keep both your hosting storage and your backups lean.
To see its size on Noiz hosting, open your hosting panel's File Manager, browse to your site's wp-content folder, and check the reported size of the uploads folder, or connect over SFTP and look at the same folder in your client. If you have SSH access, the quickest reading is:
du -sh wp-content/uploads
Note the figure. Comparing it against the total size of your hosting account tells you at a glance whether media is your storage problem, or whether the space is going somewhere else such as a database, a cache, or old backups stored inside the site.
Step 1: Audit What You Actually Have
Start inside WordPress, at Media > Library. Switch to the list view using the icon at the top left, since it shows more detail per item than the grid. The single most useful control here is the media type dropdown, which includes an Unattached option. Selecting it filters the library down to items that are not recorded as belonging to any post or page.
Understand the "Unattached" Trap Before You Trust It
It is tempting to treat everything in the Unattached list as safe to delete. Resist that, because "unattached" and "unused" are not the same thing, and confusing them is the classic way people delete images that are still live on their site. WordPress marks an image as attached only to the one post or page it was first uploaded to. That leaves a great many genuinely used images looking unattached, including:
- Your site logo, favicon, and any images set in the theme customiser or theme options.
- Images placed through a page builder or block patterns, which frequently do not create the attachment link.
- An image reused on a second page after being uploaded to a first, or inserted from the library rather than uploaded fresh.
- Header and background images, and images used in widgets or menus.
So the Unattached filter is a useful shortlist of candidates, not a delete list. Treat it as "images to investigate", and confirm each one is truly unused before removing it. The same caution applies twice over to the automated scanners covered next.
Step 2: Remove Unused Images Safely
There are two honest ways to do this: by hand, which is safe but slow, and with a scanning plugin, which is fast but needs care. Which you choose depends on how many images you have and how your site was built.
By Hand, for Small Libraries and Obvious Culprits
For a modest library, or to clear out clearly redundant items such as an old logo, duplicate uploads, or leftovers from a redesign, deleting by hand is the safest route because you look at each image before it goes. In the media library, use Bulk Select, tick the items you have confirmed are unused, and choose Delete Permanently. The important thing to know, and the reason this is clean rather than messy, is that deleting an attachment this way removes the original file and every generated size along with it. You do not need to hunt down the thumbnail copies yourself; WordPress tracks them and removes the whole set.
A useful habit before deleting anything you are unsure about: click the image, use Copy URL to clipboard from its details, and paste that URL into your browser to open the file directly. Then search your own site for where it might appear. If nothing genuinely references it, it is a safe removal.
With a Scanning Plugin, for Large Libraries
When you have thousands of images, checking each by hand is impractical, and a media cleanup plugin becomes worthwhile. Tools in this category (Media Cleaner is one well-known example, offered here only to illustrate the type) scan your posts, pages, and often your theme and settings to build a list of media that appears to be referenced nowhere, so you can review and delete it in bulk. Used carefully, they reclaim a lot of space quickly. Used carelessly, they are the fastest way to break a site, so a few rules matter:
- Take a fresh backup immediately before running one, separate from your routine backups. This is the single most important precaution in the whole guide.
- Understand what the scanner cannot see. No scanner reliably detects images referenced inside page-builder data, custom fields, serialised theme options, sliders, galleries, or hard-coded into CSS or template files. Anything it cannot parse, it may wrongly flag as unused. On a site heavy with a visual builder, this false-positive risk is real.
- Use the safety net. The better tools move "unused" files to a trash or quarantine area first rather than deleting outright, and let you empty it later once you have confirmed nothing broke. Always prefer that mode, keep the quarantine for a week or two, and browse your site thoroughly before emptying it.
- Work in batches and check as you go, rather than deleting everything the scanner offers in one click.
Step 3: Trim the Surplus Thumbnail Sizes
Removing unused images tackles half the problem. The other half is the number of resized copies made for the images you keep. If your theme registers sizes you never display, every upload is quietly wasting space, and this compounds over time.
Set Sensible Built-in Sizes
Under Settings > Media you control the three core sizes: Thumbnail (with an option to crop to exact dimensions), Medium, and Large. If your theme never uses one of these, setting its width and height to 0 stops WordPress generating it for future uploads. Do not do this blindly, though: many themes and galleries rely on the thumbnail and medium sizes, so change one, upload a test image, and check your site still looks right before committing.
Find and Retire Sizes You Never Use
The hidden extra sizes are usually the ones added by your theme and plugins, and they are not shown on the Settings screen. To see the complete list of sizes actually registered on your site, the clearest tool is WP-CLI over SSH:
wp media image-size
This prints every registered size with its dimensions and crop setting, revealing exactly what is being generated per upload. Sizes left behind by a theme or plugin you have since removed are prime candidates to retire. You can deregister an unwanted size with a small snippet in a child theme or a site-specific plugin, for example:
add_action( 'init', function () {
remove_image_size( 'unwanted-size-name' );
} );
Replace unwanted-size-name with the size's registered name from the list above. If you are not comfortable editing code, a managed-plan client can ask the Noiz support team to do this, or a reputable media plugin can toggle sizes on and off through a settings screen instead.
The gotcha that catches everyone here: changing or removing a registered size only affects images uploaded from that point on. It does nothing to the thousands of copies already sitting in your uploads folder. Those old files stay exactly where they are until you take the next step.
Step 4: Regenerate Thumbnails After Changing Sizes
Whenever you add, resize, or remove an image size, or switch to a theme with a different set of sizes, your existing images are left with the old copies: some now missing, some now surplus. Regenerating rebuilds each image's set of copies to match your current sizes, and this is also the step that finally deletes the old, no-longer-registered copies you retired in Step 3, reclaiming their space.
The Command-Line Way (Fastest and Cleanest)
If you have SSH access, WP-CLI is by far the most reliable tool, because it processes every image in one pass and, by default, deletes the outdated copies as it goes. From your site's root folder:
wp media regenerate --yes
Two options are worth knowing. If you only want to create copies that are missing, without touching or rebuilding existing ones, add --only-missing, which is much faster on a large library. If old copies are linked from elsewhere and you would rather keep them, --skip-delete preserves them instead of removing them. To rebuild a single size across all images, use --image_size, for example --image_size=large. On a big library this is a heavy job, so it is best run when the site is quiet.
The Plugin Way (No Command Line Needed)
If you do not have SSH access, a "regenerate thumbnails" plugin does the same job from inside the dashboard, working through your library in the background and rebuilding each image's sizes. It is slower than WP-CLI and heavier on the server while it runs, so start it when traffic is low. As with everything in this guide, take a backup first, and once regeneration is complete you can safely deactivate and remove the plugin. Managed-plan clients can simply ask the Noiz support team to run the regeneration for them.
Step 5: Stop the Bloat From Coming Back
A one-off clean-up is worth much more if you also change the habits that caused it. A few settled practices keep the library lean for good:
- Resize and compress before you upload. A web page almost never needs an 8-megapixel, six-megabyte original. Exporting images at a sensible width and reasonable compression before uploading is the single biggest saving you can make, and it also removes those giant retained originals from the equation.
- Keep only the sizes you actually use. Having done the audit in Step 3, revisit it whenever you change theme, since a new theme brings a new set of registered sizes.
- Consider modern image formats. WordPress can work with WebP (supported since version 5.8) and AVIF (since 6.5), both of which produce markedly smaller files than JPEG or PNG at the same visual quality. Serving these, whether by uploading them directly or using an optimisation plugin that converts on the fly, shrinks both your storage and your page weight.
- Mind the retained originals. Remember that any upload over 2560 pixels keeps its full-size original on disk. Downsizing before upload sidesteps this entirely.
- Delete media when you delete content. WordPress does not remove an image when you delete the post that used it, so clearing out old campaigns or products is a good moment to remove their images too.
Doing This on Noiz Hosting
Everything above happens inside WordPress, but the file-level and database work sits on your hosting account, and Noiz gives you a few ways to reach it. Your files, including the whole wp-content/uploads tree, are reachable either over SFTP with a client of your choice or through the File Manager built into your hosting panel, which is where you can check folder sizes and, if you ever need to, remove files by hand. Your site's database, where the media library records which files and sizes exist, is managed through phpMyAdmin from the panel. Direct file or database edits are an advanced, easy-to-get-wrong route, so treat them as a last resort behind a backup, and prefer the in-WordPress tools in this guide for day-to-day cleanup.
Because a smaller uploads folder directly means smaller, faster backups and more headroom on your plan, this is exactly the kind of maintenance the Noiz support team is glad to help with. Managed-plan clients can hand the whole job over: measuring the folder, taking the safety backup, running the regeneration, and retiring unused sizes.
Troubleshooting
- Symptom: after a cleanup, images have vanished from pages and you see broken-image placeholders. A scanner or a manual delete removed a file that was still in use, most likely one referenced through a page builder, theme option, or custom field that the scanner could not read. Restore the affected files from the backup you took beforehand, or from the plugin's trash or quarantine if it has one, then rebuild your delete list more conservatively.
- Symptom: you deleted a lot of images but the uploads folder is barely smaller. The images you removed were probably small, while the space is held by a smaller number of very large retained originals, or by the many extra sizes your theme registers. Re-measure with the folder-size check, then work through Steps 3 and 4 to trim sizes and regenerate, which is where the big saving usually is.
- Symptom: you changed the image sizes under Settings > Media but nothing on disk changed. That is expected. Size changes apply only to future uploads until you regenerate; run Step 4 to update and clean up your existing images.
- Symptom: regeneration stalls, times out, or the site slows to a crawl while it runs. Rebuilding thousands of images is demanding. Use the WP-CLI method if you can, since it is lighter than the browser-based plugins, run it during quiet hours, and if using a plugin let it finish one batch before starting the next.
- Symptom: the Unattached filter lists images you are certain are on the site. That is normal and is not a fault. Attachment status only records the one post an image was first uploaded to, so reused, builder-placed, and theme images all appear unattached. Confirm actual usage before deleting rather than trusting the label.
- Symptom: the media library shows an image but the file will not open at its URL, or vice versa. The database record and the file on disk have drifted apart, often after a partial migration or a manual file deletion. A media cleanup plugin can usually detect and reconcile these orphans in either direction; if it cannot, open a support ticket.
If your media library is large, tangled with a page builder, or you would simply rather not risk deleting the wrong thing, open a support ticket with the Noiz support team. Include your domain and roughly how much space the uploads folder is using, and a technician can take the safety backup, audit the library, trim the surplus sizes, and regenerate your thumbnails so you get the storage and backup savings without the risk.
