Your WordPress media library almost never shrinks on its own. Featured images get replaced, product photos get swapped, page-builder drafts pile up, and old uploads stay on disk—still in backups, still on the host plan, still in every full-site zip you download. The fear that stops most cleanups is rational: delete the wrong file and a hero, gallery, or Elementor section breaks.
This guide shows how to find unused images in WordPress without treating “delete everything flagged unused” as a plan. You will learn why libraries grow, what “unused” actually means, what scanners can miss, and a safe scan → verify → trash → recover workflow. A free tool path (Media Purge) is optional at the end—not the opening pitch.
One distinction up front: this article is about unused media (no detected references). Byte-identical duplicates are a different problem—covered here: find duplicate images in WordPress.
Unattached is not the same as unused
WordPress’s Media Library filter for unattached only means the file has no parent post in core—not that the file is safe to delete. Logos, Customizer uploads, page-builder backgrounds, featured images, and WooCommerce gallery assets are often “unattached” while still live on the site. Treat unattached as a weak triage signal, never as a delete list. A real unused scan (plus verify) is what separates “no parent post” from “no detected references.”
Why WordPress accumulates unused images
WordPress keeps attachment files when you upload them. Changing which image is “used” does not always remove the previous file. Typical sources of bloat:
- Replaced featured images and product photos. The old attachment often remains in the Media Library.
- Page-builder revisions and abandoned drafts. Elementor, Divi, and similar tools store image references in their own data; drafts and old revisions leave orphans behind.
- Bulk imports, stock downloads, and “try this hero” uploads from clients or teammates.
- Migrations and theme switches that orphan attachments no longer referenced in the new templates.
None of that means WordPress is “broken.” It means the platform prioritizes not destroying uploads you might still need. Cleanup is a deliberate maintenance job. For the bigger picture of media bloat, see why your WordPress media library gets out of control and the media library cleanup guide.
What “unused” actually means (and what scanners can miss)
In practice, unused means: no reference was found in the sources the scanner knows how to read. That is a detection result, not a metaphysical guarantee that no human will ever need the file.
Referenced in posts, pages, CPTs, featured images, galleries
A solid unused scan checks post/page/CPT content, featured images, gallery shortcodes or blocks, and common attachment ID / URL patterns in post meta. If a file is still the featured image on a live page, it should not appear as unused.
Referenced in builders (Elementor JSON, Divi, etc.) and Woo meta
Modern sites store many images outside the classic post body. Builders keep widget trees and layout meta (Elementor JSON, Divi module data, WPBakery shortcodes, Beaver Builder layouts). WooCommerce stores gallery arrays and product image meta. If a cleaner only reads rendered HTML or post content, builder backgrounds and product galleries produce false unused flags—and layout risk when people trust those flags blindly.
Edge cases: theme/PHP hardcodes, custom CSS, offloaded CDN URLs
Some images never appear as attachment references in the database: hardcoded paths in theme PHP, URLs only in custom CSS, or assets loaded from an offload/CDN path the scanner does not map back. Treat those as whitelist candidates, not “the scanner failed forever.” Honesty beats overclaiming.
When you evaluate any tool, look for builder-aware scanning plus Used In / usage context—and a whitelist. Media Purge documents that workflow on How it works and Features.
Manual ways to spot unused media (limited)
You can do light triage without a plugin:
- Browse Media → Library, sort by date, and spot old test uploads or obvious leftovers after a redesign.
- Open suspicious attachments and check whether WordPress shows any “uploaded to” / attachment parent context (core is limited for full site-wide usage).
- For technical users, export or inspect references at a high level—without running destructive SQL delete scripts against
wp_posts/wp_postmeta. Manual DB deletes are an easy way to orphan rows, break serializers, or remove the wrong attachment ID.
Manual review does not scale on libraries with thousands of files, and it rarely covers builder JSON or Woo gallery meta thoroughly. That is why read-only scanners exist—and why verification still matters after the scan.
A safe workflow: scan → verify → trash → recover
This is the teaching core. Tools should follow the model; the model should not depend on one brand.
Step 1: Backup (always)
Take a full backup (files + database) before bulk media work. Recoverable trash lowers regret; it does not replace backups.
Step 2: Run a read-only unused scan
Prefer scanners that inspect without deleting. Async / batched scans keep admin and front-end usable on larger sites.
Step 3: Check Used In / usage context before any delete
Open usage context for questionable items—especially templates, home sections, and product pages. If the tool offers direct edit links, use them.
Step 4: Move to recoverable trash (not permanent delete)
First pass: trash, don’t purge. Confirm the front end and critical templates. Only permanently delete when you are sure (or after retention expires on items you already chose to trash).
Step 5: Whitelist / protect assets that must stay
Before bulk trash, build a short protect / exclude list so must-keep files stop looking like cleanup candidates. Typical protect targets:
- Brand & chrome: logos, favicons, header/footer icons, email or PDF assets reused outside posts.
- Theme / Customizer / CSS-only backgrounds that never show as attachment parents in the library.
- WooCommerce catalog anchors: product images and variation galleries you still sell—even when a scanner briefly misreads meta.
- Builder “hero” backgrounds you have already verified in Elementor/Divi (or similar) after a redesign.
In Media Purge this is the Whitelist control; other tools may call it ignore, protect, or exclude. Same idea: mark keepers before you trust a bulk unused list.
Step 6: Re-scan after major redesigns
Unused media is ongoing. Re-run after theme swaps, Elementor rebuilds, or Woo catalog refreshes.
Media Purge is built around this same sequence. Product-specific walkthrough: How it works.
Using Media Purge to find unused images (soft-sell)
If you want a free unused scanner that follows verify-before-trash:
- Install from WordPress.org or getmediapurge.com/download.
- Go to Media → Media Purge and run a scan. Scans are read-only and run in asynchronous batches.
- Review the unused list with file sizes and Used In context. Filter by type; export CSV when you need client or agency sign-off.
- Trash into the internal recoverable bin. Restore from the Recovery tab within retention (default 30 days, adjustable in Settings).
- Add must-keep files to Whitelist.
Builder-aware free core (as documented): Elementor, Divi, WPBakery, Beaver Builder, Gutenberg, classic editor, WooCommerce galleries/featured, widgets, and Customizer uploads. Details: Features.
Not claimed as shipping today: scheduled auto-cleanup and one-click duplicate merge are labelled Coming Soon. Duplicate detection (MD5 group view) is available; the deep how-to lives on the duplicates post—this article stays on unused references.
Comparing free-depth cleaners vs established options? One link for that intent: Media Cleaner alternative.
After you find unused images: cleanup without panic
Finding unused images is only half the job. Cleanup discipline matters more than speed:
- Prefer staging first on builder-heavy or client sites; prove the workflow before production.
- Prioritize large files first if storage or backup size is the pain point.
- Export CSV before bulk trash when stakeholders need to approve removals.
- Trash in small batches and spot-check home, product, and template pages between batches.
- Observe before permanent delete — keep items in recoverable trash for a review window (days to a few weeks, matching your retention) so broken layouts can be restored.
- Keep the whitelist / protect list updated as brand assets change.
A deeper “delete unused media safely” piece can own that anxiety keyword later; this post stays on finding unused images and the verify → trash pattern. For capability detail on trash, recover, and whitelist, use Features.
Unused vs duplicate media (don’t mix them up)
| Unused media | Duplicate media | |
|---|---|---|
| Question | Is this file referenced anywhere the scanner checks? | Is this file byte-identical to another upload? |
| Typical cause | Replacements, drafts, migrations, abandoned builder sections | Same image uploaded twice (often different filenames) |
| Method | Reference scanning (content, meta, builders, Woo) | Hash grouping (e.g. MD5) |
| Risk if confused | Deleting a “duplicate” that is still the only live reference—or keeping orphans because you only hunted hashes |
If your problem is identical copies eating space, go to Find duplicate images in WordPress. If you are shopping plugins on free depth vs established cleaners, see Media Cleaner alternative.
FAQ
Is “unattached” the same as unused?
No. Unattached means WordPress has no parent post for that attachment. Unused (in scanner terms) means no reference was found in the sources the tool checks. Many live site assets are unattached. Never bulk-delete from the unattached filter alone.
Will finding unused images delete them automatically?
Not if you use a read-only scan and an explicit trash step. In Media Purge, scanning does not delete; trashing is a separate action, and recovery exists within retention.
Can unused scans break Elementor or Divi?
Risk drops when builder data is included in the scan and you verify Used In before trash. Edge cases (theme PHP / CSS-only URLs) should be whitelisted. Backups still recommended.
What about images only in CSS?
Database-oriented scanners often cannot see them. Whitelist those files so they are not offered for cleanup.
Is Media Purge free for finding unused images?
Yes for core unused scan, review, trash, restore, whitelist, and CSV export. Scheduled automation is Coming Soon—not presented as available now.
How is this different from finding duplicates?
Unused = no detected references. Duplicates = identical file bytes. Different methods, different cleanup decisions. Details: find duplicate images in WordPress.
Next steps: Download Media Purge · WordPress.org plugin · How it works · Features · Media library cleanup guide · Media Cleaner alternative

