In short

  • Make a full backup (files and database) before you remove anything.
  • “Unattached” in the Media Library does not mean unused: check where an image is used before you delete it.
  • There are three kinds of waste: Media Library items nothing uses, files the Media Library does not know about (old thumbnail sizes, copies, backup folders), and very large originals.
  • Remove in two steps: move files somewhere you can restore them from, check the site, then delete for good.

A WordPress uploads folder grows quietly. Every image you upload is stored several times, themes and page builders leave their own copies, imports bring files twice, and nobody deletes the picture of a post that was taken down three years ago. The result is a hosting account that runs out of space, backups that take longer every month and a migration that drags. This guide shows how to find unused images in WordPress, how to tell them apart from images that only look unused, and how to remove them with a way back.

Why Unused Images Pile Up

When you upload a photo, WordPress keeps the original and creates resized copies for every image size the theme and plugins register: thumbnail, medium, large and several more. A site with ten registered sizes stores eleven files per upload. Since WordPress 5.3, an upload larger than 2560 pixels also gets a “-scaled” copy, and the original stays next to it.

The waste comes from a few places:

  • Theme changes. A new theme registers new sizes. The files of the old theme’s sizes stay in the uploads folder, although nothing asks for them any more.
  • Duplicates. The same photo uploaded twice, saved again under another name, or imported with a demo or a migration plugin.
  • Plugin leftovers. Sliders, galleries and page builders that make their own copies, and backup or cache folders inside uploads.
  • Deleted content. Removing a post does not remove the images it used.

Before You Delete Anything

  1. Make a full backup of the files and the database, and check that you can restore it. Deleted images cannot be brought back from inside WordPress.
  2. Use a staging copy if your host offers one, at least for the first cleanup.
  3. Check where your images live. If an offload or CDN plugin moves images to cloud storage, the files may not be in the uploads folder at all; follow that plugin’s own cleanup instructions.
  4. Write down a few key pages (home, best-selling products, most-read posts) to check after the cleanup.

What "Unused" Really Means

An image is used when any part of the site points to it, and WordPress records those uses in many places: the post content, the featured image, galleries, custom fields such as ACF fields, page builder data, widgets, the logo and site icon, the theme’s settings and CSS backgrounds, and WooCommerce product galleries. Other websites and old newsletters may link to your image addresses too, and no plugin can see those.

Media Library items that nothing uses

These are files WordPress knows about: they appear in Media → Library. The Library’s “Unattached” filter is tempting, but it only shows items that were not uploaded from inside a post. A logo uploaded directly to the Library is “unattached” and very much in use; an image uploaded into a post and later removed from its text is “attached” and unused.

Files the Media Library does not know about

Old thumbnail sizes, copies left by plugins, files added by FTP and backup folders are not in the Media Library at all, so you cannot see or delete them there. They are often the biggest part of the waste.

Large originals and oversized images

The originals WordPress keeps next to a “-scaled” copy and photos uploaded straight from a camera are not unused, but they take a lot of space. Treat them separately: you may want to keep the originals, or resize them instead of deleting them.

Option 1: Check by Hand in the Media Library

For a small site with a few hundred images, a manual check works:

  1. Open Media → Library and switch to the list view.
  2. Sort by date and start with the oldest uploads, or use the “Unattached” filter as a first list of candidates, keeping its limits in mind.
  3. For each candidate, copy the file name and search for it under Posts and Pages (the admin search also looks in the text). Check the theme’s logo, header and background settings and your widgets.
  4. If you find no use, select it and choose Delete permanently. WordPress removes the item, the original file and all its resized copies.
  5. Open the key pages you noted and check that nothing is missing.

This is slow, it cannot see files outside the Media Library, and a search of the text misses uses in custom fields and page builder data.

Option 2: The Uploads Folder, With SFTP or WP-CLI (Advanced)

If you are comfortable on the command line, you can look at the uploads folder directly. du -sh wp-content/uploads/* shows which year folders take the space, and wp media image-size lists the image sizes registered right now, so you can spot files of sizes that are no longer registered. Never delete straight from the server: move candidates to a folder outside the web root, check the site for a few days, and only then delete them. A file name alone does not tell you whether a page builder or a custom field still points to it.

Option 3: A Plugin That Checks Every Use

Disclosure: Clearyvo Media Cleanup is our own free plugin. Other plugins do this job too, for example Media Cleaner by Jordy Meow; our comparison of Clearyvo Media Cleanup and Media Cleaner shows where they differ.

Clearyvo Media Cleanup covers both kinds of waste. Its Unused in Library list shows the Media Library images nothing on the site uses: not in any content, featured image, gallery, WooCommerce gallery, widget, menu, theme setting, option or page-builder data. Images attached to a post that does not show them are listed apart (“Attached, not shown”), as less certain, and are never ticked for you. Uploads of the last 30 days (the default; you can change it) are never offered, because a new image may be meant for a page you have not published yet. In the uploads folder it also finds identical copies (same SHA-256), look-alikes saved again at a lower resolution (confirmed by a picture comparison), old thumbnail sizes WordPress no longer lists, files in backup folders, and full-size originals next to their “-scaled” copy. An image in use is never moved. Nothing is deleted straight away: files go to a quarantine you can restore from for 3, 7, 10 or 30 days.

  1. Install it under Plugins → Add New Plugin (search for “Clearyvo Media Cleanup”) and activate it.
  2. Open Media Cleanup and run the scan. It works in short, resumable steps, so it finishes on shared hosting and large libraries.
  3. Read the lists. Each file has a small preview and the reason it is offered.
  4. Tick the files you want to remove and move them to the quarantine.
  5. Browse your key pages. If anything is missing, restore the file from the Quarantine view with one click.

An unused Media Library image goes to the quarantine with every size, and its Media Library entry is kept (hidden), so a restore brings the whole item back. Each file is checked again against the live site right before it is moved, and if a page or a visitor later asks for a quarantined file, a notice names the file and the page, with a Restore button. Unused in Library covers images; PDFs are the job of PDF Cleanup. In the free plugin you tick the items you want to move; for large libraries, the paid add-on Media Cleanup Pro (also included in Clearyvo Pro) moves a whole list in one step, groups every copy of a picture, suggests which one to keep and makes WebP and AVIF copies; after buying it, see Install your Pro plugin.

After the Cleanup

  • Open your key pages, including a few old posts, and look for missing images. A broken link checker that also checks images, such as the one in our guide on finding and fixing broken links, does this for every page.
  • Clear your page cache and CDN, so visitors do not get cached pages that point to removed files.
  • Check the size of your next backup: it should be smaller.
  • If a page asks for an image size that is gone, WordPress or a thumbnail regeneration plugin can create it again from the original.

Keep It Clean

Resize photos before you upload them, delete the images of a post together with the post when they are not used elsewhere, avoid uploading the same picture twice, and run a check after every theme change. A cleanup twice a year keeps the uploads folder close to what the site really shows.

Frequently Asked Questions

Is it safe to delete unattached images in WordPress?

Not without checking. “Unattached” only means the image was not uploaded from inside a post. It can still be a featured image, a logo, a gallery item, a background in the theme settings or part of page builder data. Check where each one is used first, or move files to a quarantine you can restore from instead of deleting them.

Does deleting an image in the Media Library delete the file?

Yes. “Delete permanently” removes the Media Library item, the original file and every resized copy WordPress made of it. WordPress has no media trash unless the MEDIA_TRASH constant is set to true in wp-config.php, so make a backup first.

How do I find duplicate images in WordPress?

The Media Library does not show duplicates. Compare files by their content, not by their name: identical files have the same checksum (for example SHA-256), and a picture saved again at a lower resolution needs an image comparison. A plugin that does both, such as Clearyvo Media Cleanup, keeps the copy the site uses.

Can I delete the original images WordPress keeps next to the "-scaled" copy?

Since WordPress 5.3, very large uploads get a smaller “-scaled” copy that the site shows, and the original is kept. Removing the original frees space, but you lose the full-resolution source for later edits or prints. Remove it only when the “-scaled” copy stays and you have a backup of the original.

Will deleting unused images make my site faster?

Usually not for visitors: a page loads only the images it shows. Removing unused files makes the uploads folder, your backups and migrations smaller and faster. To make pages faster, compress and resize the large images that are actually shown.