Most WordPress sites carry hundreds of images nobody sees anymore, each saved in five or ten sizes. Deleting them makes backups lighter and can keep you under your host’s disk limit. But the usual advice, “filter by Unattached and delete”, breaks sites. Here is how to do it safely.
In 30 seconds
- “Unattached” in the Media Library does not mean unused. Never bulk-delete from that filter.
- A real cleanup checks where every file is used: posts, pages, custom fields, page builders, widgets, theme settings.
- Back up first, delete to a trash (not permanently), browse your site, and only empty the trash a week later.
- Some uses are invisible to any scan: CSS backgrounds, hard-coded theme files, old newsletters. Keep those in mind.
- I made Media Cleaner for exactly this. The free version covers most sites.
Why unused images pile up
Every image you upload becomes several files: the original plus every size WordPress, your theme and your plugins register (thumbnail, medium, large, and often a few more). Then life happens. You replace a photo in a post, delete an old page, switch themes, drop a gallery plugin, try a page builder and leave it. The files stay. On a site a few years old, it’s common to find that a large share of the uploads folder is never shown to anyone.
It costs you in three ways: slower and heavier backups, a cluttered Media Library where you can’t find anything, and on many hosts, disk space you pay for. On my own travel site, keeping the library clean is what keeps it under my host’s disk limit.
“Unattached” does not mean unused
This is where most guides go wrong. In Media → Library, list view, you can filter by Unattached. It’s tempting to select everything and delete. Don’t.
- “Attached” only means “uploaded from inside a post”. An image you uploaded from the Media Library and then inserted into ten posts is still “Unattached”, and very much in use.
- Your logo, header, favicon and page-builder images are usually unattached too.
- The opposite is also true: an image uploaded into a post and later removed from its text stays “Attached” forever, even though nobody sees it.
The filter tells you where a file was uploaded, not where it’s used. To know if an image is used, something has to look at every place it could appear.
The safe way, step by step
- Make a full backup (files and database), and know how to restore it. Most hosts do it in one click.
- Scan for real usage. Install Media Cleaner (free), go to Media → Cleaner and click Scan. It looks for each file in your posts, pages and the places supported themes and plugins store images, then lists only the ones it can’t find.
- Read the list before deleting. Each file shows why it was reported. Anything you know is used (a logo, a file linked from elsewhere): click Ignore, and it won’t come back.
- Delete to the trash, not forever. Media Cleaner moves files to its own trash first, so you can restore anything in one click.
- Browse your site. Home page, a few posts, a product page, the pages built with a page builder. If an image is missing, restore it from the trash.
- Empty the trash a week later. That’s when the space is actually freed.

That warning in the screenshot matters. When a scan reports a big part of your library, it usually means it can’t see how a builder or a custom plugin uses images, not that half your site is unused. In that case, move a handful of files to the trash, check the site, and only then go further.
What no scan can see
Be honest with yourself about these, because no plugin can find them:
- Images written directly in theme files or CSS (a background image in style.css, a logo hard-coded in header.php).
- Images used outside your site: old newsletters, other websites, social posts that link straight to your uploads folder.
- Plugins that store images in their own way (some sliders, builders and form plugins). Media Cleaner Pro supports many of them (Elementor, Divi, WPBakery, Avada, Beaver Builder, ACF, Slider Revolution and more), but check the list against your site.
That’s exactly why the trash and the “browse your site” step exist.
Files that aren’t even in the Media Library
Old plugins, failed uploads and migrations often leave files in wp-content/uploads that the Media Library doesn’t know about. They take space and never show up in Media → Library. Media Cleaner Pro can scan the uploads folder itself and list them. Its Storage view also shows what takes space, and thumbnail sizes nothing asks for anymore:

For the image sizes themselves (which sizes exist, regenerating thumbnails, WebP and AVIF), Perfect Images is the other half of the job.
Let an AI assistant do it
If you use Claude or ChatGPT with AI Engine’s MCP server, Media Cleaner works through it too: the assistant runs the scan, explains why each file was reported, ignores the false positives and moves the rest to the trash. Permanent deletion always waits for your explicit OK. “Check what Media Cleaner would delete, and tell me which ones look risky” is a good first question.
Questions people ask
Is it safe to delete unattached images in WordPress? Not by that filter alone. Unattached only means the image wasn’t uploaded from inside a post. Many unattached images are in use. Check real usage first.
Will deleting unused images break my site? Not if they’re really unused. The risk is a file that’s used somewhere a scan can’t see. Delete to a trash, browse your site, and keep a backup until you’re sure.
Does deleting an image remove its thumbnails too? Yes, when you delete it through WordPress or Media Cleaner, all its sizes go with it. Deleting a file by FTP doesn’t clean the database, so avoid that.
Will it make my site faster? Not much for visitors: unused files aren’t loaded. The gains are lighter backups, faster migrations, a tidy library and less disk space.
Is there a free way? Yes: Media Cleaner is free on WordPress.org and covers most sites. Pro adds the uploads-folder scan, page builders and complex plugins, and WP-CLI.
Clean once, then every few months. A tidy library is one of those things you don’t notice until you’ve done it. 😺