Every time you upload a photo, WordPress generates multiple hidden size variations to fit your theme and device breakpoints. These extra files consume storage, bloat backups, and can push you past hosting limits. Most of these sizes are never used, so cleaning them up safely can free significant space and speed up backups.
Quick Summary: Use the WP Media Cleanup plugin to scan for unused image variations and safely bulk-delete them while preserving original source files and common theme assets like logos.
Why delete unused image duplicates?
– WordPress creates several sizes (thumbnail, medium, large, and theme/plugin-specific sizes) for every upload. Over time, these add up.
– Example: a 2 MB original plus five 500 KB variations equals 4.5 MB total.
– Benefits of cleanup:
– Smaller, faster backups
– Reduced disk usage and lower hosting costs
– Easier site migrations
– Fewer files to hit host file-count limits
– Less confusion from duplicate files
Before you start
– Make a complete backup of your site. WP Media Cleanup keeps deleted variations in a 30-day backup, but a full backup is a best practice—especially for custom themes.
Step 1: Install and scan for unused images
1. Install and activate WP Media Cleanup (by Duplicator).
2. Enter and activate your license key (if required).
3. Clear your WordPress cache so the plugin sees current content.
4. Go to Media Cleanup » Cleanup and run “Scan for Unused Variations.”
5. Wait for the scan to finish. The plugin shows a list of images with unused variations, previews, filenames, counts, and space used.
6. Click “Show Details” to see specific sizes targeted (e.g., medium, large, 1536×1536).
Step 2: Review and delete unused variations
– Deletion options:
– Delete All: remove every unused variation from the scan.
– Delete Selected Variations: pick specific files with checkboxes.
– Individual Delete: remove variations for a single image.
– WP Media Cleanup targets only auto-generated size variations (e.g., -150×150.jpg) and keeps original source files intact.
– A confirmation dialog appears before deletion to prevent mistakes.
Step 3: Restoring deleted images (if needed)
– Deleted variations are backed up by the plugin for 30 days.
– If you see a broken image on the site:
1. Right-click the broken image and “Copy Image Address.”
2. Paste the URL and copy the filename (e.g., my-header-image-150×150.jpg).
3. In WP Media Cleanup’s Restore page, paste the filename in the search box to filter.
4. Select the file and click Restore.
– Note: backups are removed after 30 days, so check important pages soon after cleanup.
If you change themes
– New themes can require different image sizes. Use a Regenerate Thumbnails plugin to recreate required sizes after switching themes.
Advanced: Automating media cleanup with WP-CLI
– WP Media Cleanup supports WP-CLI for automated scans and deletions—useful for developers and agencies managing many sites.
– Typical commands:
– Find and review unused variations:
wp media-cleanup find_unused –format=table
– Delete with confirmation:
wp media-cleanup delete_unused –yes
– Check storage statistics:
wp media-cleanup stats
– SSH access and WP-CLI are often available on VPS or managed hosting. Budget shared hosts may not provide this.
Bonus: Optimize the remaining media files
– After deleting extra sizes, compress the original images you keep to reduce page load times and storage.
– Use an image compression plugin to shrink files without visible quality loss.
– Cleaning first reduces the number of files you need to compress (saving plugin credits and time).
FAQs
– Is it safe to delete unused media files?
– Yes, with a dedicated tool like WP Media Cleanup. It targets auto-generated variations and protects originals. Still, make a full backup beforehand in case custom-coded image references weren’t detected by the scanner.
– How does WordPress create extra image files?
– WordPress and themes/plugins generate multiple sizes when an image is uploaded to serve appropriate resolutions and layouts.
– How often should I clean my media library?
– For busy sites, every 3–6 months. Smaller sites can often do an annual cleanup.
Additional resources
– How to Optimize Images for Web Performance
– Best WordPress Image Compression Plugins Compared
– The Ultimate Guide to Boost WordPress Speed & Performance
– Best WordPress Backup Plugins Compared
Cleaning unused image variations is a simple, high-impact way to reclaim server space, speed backups, and reduce hosting costs. Use WP Media Cleanup to scan, review, and safely remove unused sizes, restore any needed files from the plugin’s 30-day backup, and then optimize the remaining images for the best site performance.

