WordPress creates multiple hidden size variations for every uploaded image to serve different layouts and devices. Those extra files can quickly eat storage, bloat backups, and push you past hosting file limits. Many variations are never used and simply accumulate on your server.
Using an automated cleanup tool is the fastest, safest way to reclaim that space. This guide explains how to scan for unused image variations with WP Media Cleanup, safely bulk-delete them, and restore any missing files if needed.
Quick summary
– WordPress generates many copies for each upload. Use WP Media Cleanup (by Duplicator) to find unused variations and remove them while keeping original files safe.
Why remove unused image variations
– Each upload often produces thumbnails and several size variations. Multiple derivatives can multiply total storage per image.
– Themes and plugins add custom sizes you may never use.
– Removing unused variations reduces backup size, frees storage, and makes your media library easier to manage.
Step 1 — Install and scan
1. Install and activate WP Media Cleanup (by Duplicator).
2. Back up your site before running mass deletions — always a best practice.
3. Clear any WordPress cache so the plugin sees current site content.
4. Open Media Cleanup » Cleanup, enter and activate your license, then start a scan for unused variations.
5. Wait for the scan to complete. The plugin shows images with unused sizes, previews, filenames, number of unused variations, and space used. Click Show Details to see exact sizes such as medium, large, or 1536×1536.
Step 2 — Review and delete
– Delete All: remove every unused variation for the largest space savings.
– Delete Selected Variations: check specific variations to delete only chosen items.
– Individual Delete: delete variations for a single image.
WP Media Cleanup only targets generated size variations (for example image-150×150.jpg) and leaves the original upload untouched. Each deletion requires confirmation to help prevent accidental removals.
Step 3 — Restore if needed
– The plugin keeps backups of deleted variations for 30 days so you can restore a missing file if a layout breaks.
– To locate a missing variation, right-click the broken image on your site, copy its image address, and extract the filename (for example my-header-image-150×150.jpg).
– In the plugin Restore page, paste that filename into the search box, select the file, and click Restore.
– After cleanup, browse important pages to confirm everything displays correctly. Backups are removed permanently after 30 days.
Advanced: automate with WP-CLI
If you manage many sites or prefer command line and have SSH access, WP Media Cleanup supports WP-CLI for faster bulk operations:
– Find unused: wp media-cleanup find_unused –format=table
– Delete unused with confirmation: wp media-cleanup delete_unused –yes
– View stats: wp media-cleanup stats
Note: shared budget hosting may not provide SSH or WP-CLI; VPS or managed hosting often do.
Bonus: optimize the originals you keep
After removing unused variations, compress and optimize the remaining original images to reduce file sizes and speed up pages. Run an image compression plugin after cleanup so you only optimize files you intend to keep, saving credits and time.
FAQs
Is it safe to delete unused media files?
Yes when you use a dedicated tool like WP Media Cleanup that preserves originals and keeps deleted variations for 30 days. Still, perform a full site backup before bulk deletions in case custom-coded images are missed.
How does WordPress create so many files?
WordPress, themes, and plugins create multiple sizes on upload to serve appropriate images for different contexts. Over time those variations can outnumber originals.
How often should I clean the media library?
For busy sites, every 3 to 6 months is a good cadence. For smaller sites, an annual cleanup is usually enough.
Further reading and next steps
– Learn about image formats and responsive images
– Compare image compression plugins and settings
– Improve overall site speed and caching strategy
– Review backup plugins and recovery workflows
Cleaning unused image variations is a simple, effective way to shrink backups, lower hosting costs, and keep your WordPress site lean and performant.