Deleting unused media reduces storage and makes editorial work easier, but an attachment can be referenced far outside the post editor. Builders, custom fields, CSS, widgets, metadata, feeds, products and external systems all use files without an obvious attachment relationship.
Never bulk-delete on production
Do not run a mass cleanup on a live media library without a tested backup and a review window you can roll back within.
Step 1: Define the goal
Decide whether you want lower storage, a cleaner editor, smaller backups, fewer duplicates or removal of obsolete private material. Deleting files does not speed up public pages that never loaded them.
Step 2: Create recoverable backups
Back up the database and the uploads directory separately, then prove you can restore both to staging. Record the backup date, location, retention period and the person responsible.
Step 3: Inventory media use
Export attachment IDs, URLs, file paths, sizes, types, dates and generated variants. List every system that might store a media reference: builders, custom fields, WooCommerce products, galleries, sliders, forms, email templates, CSS, options and APIs.
Step 4: Remove obvious duplicates at the source
Find repeats by file hash rather than filename. Keep the version with the correct crop, metadata, rights and live references.
Step 5: Treat scanner output as candidates
A media cleaner scan can suggest unused files, but detection depends on integrations and site structure. Every result is a review candidate, not proof that deletion is safe.
Step 6: Test on staging
Copy the site, run the proposed cleanup, clear caches and crawl representative pages: home, archives, posts, landing pages, headers, footers, popups, forms, products, variations, account areas, email, social previews, feeds and structured data.
Step 7: Quarantine before deleting
Move candidates to a reversible trash state where possible, and keep the window long enough to cover scheduled campaigns and rarely visited content. Log attachment IDs, paths and reasons.
Step 8: Delete in small batches
Start with a small, well-understood group. Monitor missing-file errors, support reports, visual regressions and application logs, and stop as soon as a deletion reveals an untracked dependency.
Step 9: Regenerate only when needed
Use a thumbnail regeneration tool after changing registered image sizes, and back up first. Do not regenerate to paper over an unresolved reference problem.
Step 10: Prevent future clutter
- Define upload dimensions, naming and rights records
- Assign alt-text ownership and replacement rules
- Register only the image sizes the current design needs
- Schedule periodic audits rather than one heroic cleanup
Cleanup is not optimisation
Storage cleanup shrinks backups and admin clutter. Page speed improves only when you reduce the files, queries or work on pages that visitors actually load.
Read next
- ShortPixel review - compress the images you keep
- Import and export plugins - moving media between sites cleanly
- Run a live speed test - measure the pages visitors load
Common questions
Does unattached mean unused?
No. Attachment status misses builder content, theme options, products, custom fields, CSS rules and external pages.
Can deleting thumbnails break images?
Yes. Templates and responsive markup request generated sizes. Confirm registered sizes and regenerate carefully.
Will media cleanup make WordPress faster?
It shrinks backups and admin clutter. Public speed only improves when the cleanup reduces work on served pages.
Fast WordPress editorial
Independent research edition · Published 10 September 2026. We update field guides when a plugin's documented capabilities change.









































































