Every time you upload an image, WordPress generates multiple hidden size variations for different layouts and devices. Those extra files quickly consume storage, bloat backups, and can even push you over host file limits. Many of those sizes are never used and sit on the server like digital clutter.
Using an automated cleanup tool is the safest, fastest way to reclaim that space. This guide shows how to scan for unused image variations and safely bulk-delete them so your site and backups stay lean.
Quick summary: WordPress creates many copies of each upload. Use the WP Media Cleanup plugin to identify unused variations and remove them without touching your original source files.
Why remove unused image variations
– Each upload can produce several derivative files (thumbnail, medium, large, etc.). If an original is 2 MB and WordPress makes five 500 KB variations, total storage climbs quickly.
– Many themes and plugins add custom sizes that you may not use.
– Removing unused variations reduces backup sizes, storage usage, and hosting costs, and simplifies media management.
Step 1 — Install and scan
1. Install and activate WP Media Cleanup (by Duplicator).
2. Back up your site before running mass deletions — it’s a best practice.
3. Clear your WordPress cache so the plugin sees current content.
4. Open Media Cleanup » Cleanup, enter and activate your license, then click “Scan for Unused Variations.”
5. Wait for the scan to finish. The plugin lists images with unused sizes, showing previews, filenames, number of unused variations, and space used. Click “Show Details” to see specific sizes (e.g., medium, large, 1536×1536).
Step 2 — Review and delete
– Delete All: Remove every unused variation found for the biggest space saving.
– Delete Selected Variations: Select specific files with checkboxes to remove only chosen items.
– Individual Delete: Remove variations for a single image.
WP Media Cleanup targets only generated size variations (like image-150×150.jpg) and leaves original uploads intact. Each delete requires confirmation to prevent accidental removal.
Step 3 — Restore if needed
– The plugin backs up deleted variations for 30 days. If a layout breaks after cleanup, you can restore the missing file.
– To find a missing variation, right-click the broken image on your site, copy the image address, then paste and extract the filename (e.g., my-header-image-150×150.jpg).
– In the plugin’s Restore page, paste that filename into the search box, select the file, and click Restore.
– Browse your important pages after cleanup to confirm everything displays correctly. After 30 days, backups are permanently removed.
Advanced: Automate with WP-CLI
If you manage multiple sites or prefer the command line and your host provides SSH, WP Media Cleanup supports WP-CLI:
– 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
Using WP-CLI is faster for bulk maintenance across many sites. Note: budget shared hosting often lacks SSH/WP-CLI; you may need VPS or managed hosting.
Bonus: Optimize the originals you keep
After removing unused variations, compress and optimize the remaining original images to further reduce file sizes and speed up pages. Using an image compression plugin after cleanup saves credits and time because you only compress files you intend to keep.
FAQs
Is it safe to delete unused media files?
Yes, when using a dedicated tool like WP Media Cleanup that protects original photos and backs up deleted variations for 30 days. Still, make a full site backup before bulk deletions, especially if your theme uses custom-coded images the scanner might miss.
How does WordPress create so many files?
WordPress and themes/plugins generate multiple sizes on upload to serve appropriate images for different contexts. Over time these variations can outnumber originals.
How often should I clean my media library?
For busy sites, every 3–6 months is a good rhythm. For smaller sites, an annual cleanup usually suffices.
Additional resources
After cleaning your library, consider learning more about:
– Optimizing images for web performance
– Best image compression plugins
– Improving site speed and performance
– Backup plugins and strategies
Cleaning unused image variations is a quick, safe win to reduce backups, lower hosting costs, and keep your WordPress site running efficiently.