To remove unused images from the WordPress Media Library safely, scan for files that no content uses, review the list by hand, move the unwanted ones to a trash you can restore from, check your pages, and only then delete for good. WordPress has no built-in tool for this. OG Media Cleaner is the plugin we build for it.
We have done this the hard way. In September 2026 a crawl test left about 13,000 unused images in our own Media Library. Clearing them took the uploads folder on og-nexus.com from 5.9 GB down to 2.2 GB. It was slow, careful work, and it is why this guide puts the review step ahead of the delete button.
Can WordPress find unused images by itself?
Only roughly. In Media > Library, switch to list view and pick the Unattached filter. The Media Library screen documentation explains it.
It is a quick first look, and no more. Unattached does not mean unused. An image you picked from the library for a second page, a product gallery or a page builder section can show as unattached while it is live on your site. Deleting by that filter alone is how pages lose their pictures.
How do images end up unused?
- You upload three versions of the same photo and use one.
- You test an image and never use it.
- You delete a page but forget the picture that belonged to it.
- You replace a product photo and the old one stays behind.
Each file is small. Together they make the library slow to search, and they add weight to every backup.
How do I remove unused images step by step?
- Make a full backup of your WordPress files and database. Keep it off the website.
- Open Media > Cleaner and run the Clean Library scan. It checks each library item against your posts, pages, other post types, metadata and widgets.
- Review each result. Keep anything a page, product, form, theme or plugin might use.
- Mark doubtful files as ignored, so they stop coming back in future scans.
- Move only clearly unwanted files to Media Cleaner’s trash.
- Open your important pages, galleries and products. Check every picture still appears.
- Empty the trash only once you are happy. That last step is permanent.
We are in no hurry with step 7 ourselves. On 27 November 2026, six thumbnail files from an earlier scan were still sitting in the trash on og-nexus.com.
Which settings matter for the scan?
- Content (Check): on by default. It is the check that looks for each file in your content. With it off, the scan only finds broken entries, where the file is missing from the disk.
- Images Only (Enable): scans images and leaves PDFs, video and other media out.
- Attached Images (Consider as In Use): counts anything attached to a post as used. Turn it on if you want to be cautious.
- Skip Trash (Yes): makes deleting permanent. Leave this off.
What can a scan not see?
A cleaner reads your content to decide what is used. That is never proof a file is unused. OG Media Cleaner cannot see media that is:
- Used only in PHP code, a theme template or an unsupported custom field.
- Built in JavaScript, or added by an outside service.
- Used on another site of a multisite, or on a staging copy sharing the same uploads.
So if your theme hard-codes a logo, the scan may list that logo as unused. Check results like that by hand. If you are unsure about a file, keep it. A little extra storage is better than a broken page.
How often should I scan?
Often. On 27 November 2026 our library held 1,433 items, and our last identical-files scan listed just six to review. Compare that with the 13,000 from September. Clutter is easy while it is small, and a real job once it is not.
What do I get with OG Media Cleaner?
OG Media Cleaner is a paid plugin, with one licence key per site, yearly or lifetime. The Clean Library scan and the built-in parsers for WordPress, WooCommerce and OG Gallery are the basics.
An active licence adds the Clean Uploads Folder scan, which walks the files on the server and finds ones the library does not even list. It also adds more than 70 extra parsers for page builders, custom fields, sliders and galleries, and WP-CLI support for running scans over SSH.
Thumbnails, retina and WebP versions are handled together with the original file, so you do not leave half an image behind.
Where can I read more?
See the OG Media Cleaner product page, or read How to Clean Up Your WordPress Media Library, which uses our own library as the example. The documentation lists every setting.
For the same job on database rows, read how to clean up your WordPress database safely.




