Media Size Cleanup
Remove the image size files your theme no longer uses, rebuild the sizes you keep and clear out orphan files, with a backup you can restore in one click.
- Media Size Cleanup
WordPress copies every uploaded image into each registered size. Switch themes, change the sizes under Settings > Media or remove a plugin, and the old copies stay on disk for good. On a site with a few thousand images that is often gigabytes nobody uses. Media Size Cleanup finds those files and removes them safely: scan first, move them to a backup, rebuild the sizes you keep, and restore everything in one click if something looks wrong. Every feature is free, with no upgrade to buy.
Features
- Pick the sizes to keepEvery size WordPress, your theme and your plugins register is listed with its dimensions and crop. Turn off the ones your theme does not use. Files of sizes nobody registers any more are always removed.
- Rebuild with current settingsThe sizes you keep are created again with your current Settings > Media values, so files with old dimensions are replaced by correct ones.
- Leftover filesSize files on disk, such as photo-300x200.jpg, that the image data no longer lists are found and removed too.
- Rebuild missing sizes onlyCreates the kept sizes for images that lack them, without removing a single file. Handy after adding a new theme.
- Orphan filesFinds files in the year and month upload folders that no media item uses, usually left behind when a delete did not finish, and moves them to a backup.
- Scan first, alwaysA scan is a dry run that lists every file it would remove, grouped by size, with a CSV download. The cleanup button only turns on after a scan with the same settings.
- Backup and one-click restoreFiles move to a backup folder in uploads together with each image's old size data. Restore puts every file back. Files are only deleted for good when you type DELETE.
- Safe for old postsFiles linked in posts, pages, custom fields or settings are skipped, and the uploaded original, the full-size original of a scaled image and editor backups are never touched.
- Works on large sitesThe work runs in short batches, so it never hits a PHP time limit, and only the browser tab that started a run can drive it. You can stop at any time.
Screenshots
How to use
- Download the ZIP, then in WordPress go to Plugins > Add New Plugin > Upload Plugin, choose media-size-cleanup.zip, install and activate it.
- Open Media > Size Cleanup and go to Image sizes. Turn off the sizes your theme does not use and check the options.
- Click Scan (dry run). Nothing changes; you see every file that would be removed, per size, with a CSV download.
- Click Start cleanup. The files move to a backup and the sizes you keep are rebuilt. Keep the tab open until it finishes.
- Check your site for a few days. If something looks wrong, click Restore under Backups; if all is well, delete the backup to free the space.
FAQ
Is a scan safe to run on a live site?
Yes. A scan only reads. It changes no file and no database entry.
How do I undo a cleanup?
Open Media > Size Cleanup > Backups and click Restore next to the cleanup. The files go back to their folders and each image gets its old size data back.
Will images in my posts break?
Not with "Skip files linked in your content" on, which is the default. Any file linked in post content, excerpts, custom fields or settings is kept, even when its size is removed.
Where are the backups, and when should I delete them?
In wp-content/uploads/media-size-cleanup-backup/. Check your site for a few days after a cleanup, then delete the backup under Backups to free the space.
What happens to the backups when I delete the plugin?
They stay, because they hold your files. Delete them under Backups first, or remove the folder yourself. Deleting the plugin removes only its saved settings and run data.
Does it work with WebP and AVIF?
Yes. WebP and AVIF versions that WordPress or an image plugin records in the image data count as used, and so do files named like photo.jpg.webp next to photo.jpg.
Does it work with images on a CDN or cloud storage?
It works on the files in your uploads folder. Images that live only on remote storage are not changed.
How long does a cleanup take?
A scan is quick. A cleanup with rebuild on takes about as long as regenerating thumbnails, because every image is resized again. Keep the tab open while it runs; you can stop it at any time.
Is it free?
Yes. Media Size Cleanup is free software under the GNU General Public License, version 2 or later, with every feature unlocked. You may use, change and share it under the terms of that license. If it saves you space, you can support its development with a coffee.
How do I get help?
Read the documentation, or reach us through the support page.
What's new
- 1.2.0(November 9, 2026)A new screen under Media > Size Cleanup with Overview, Image sizes, Orphan files and Backups. The cleanup turns on only after a matching scan, the page remembers your sizes and options, deleting for good needs DELETE typed in the dialog, and a run can be stopped. A failed rebuild keeps the image's size files, and a restore that can not put every file back keeps the backup. Now licensed under the GPL, version 2 or later.
- 1.1.0(October 27, 2026)Orphan files: find files in the year and month upload folders that no media item uses, and move them to a backup.
- 1.0.2(October 27, 2026)Rebuild missing sizes only. A size the rebuild can not create keeps its old file, and only the browser tab that started a run can drive it.
- 1.0.0(October 26, 2026)First release: pick the sizes to keep, rebuild with current settings, leftover files, scan with CSV, backup and restore.