Delete Unused Images

Why should I delete unused images?

Unused images take up your time and money. They clutter up your WordPress Media Library so that you and any other author need more time to navigate it. Unused images also occupy disk space, increasing your hosting bill and causing longer backup times.

Easily delete unused images!

✔ Find all images not associated with any content.
✔ Identify images uploaded to posts that are no longer used.
✔ Perform a deep check in options and metadata
✔ Safely delete unused images in bulk

Why do unused images exist?

Content updates

Whether you just write an article or update an existing one, images sometimes need updates, too. It is quick and easy to remove images from the post editor and so often forgotten to remove them for good.

Multiple authors create posts

Your team is busy creating and updating a lot of content. While you might allow authors to add images to posts, they might not have sufficient rights to delete old images. They might not even know how to properly check – which often needs developer skills anyway.

Updating your website

You created a lot of test content and elements for your new project. Maybe, you changed the theme a couple of times and tested many plugins. All this created digital waste, which you might want to remove before the changes go live.

Did you know? For every image you upload, WordPress stores it in multiple sizes. It only displays the appropriate size on smaller devices, which is great for the performance of your website. But this also means that each image in your media library is, in fact, multiple images, taking up a lot more disk space.

The number of unused images and the disk space it reserves showing in the WordPress dashboard.

Why you should delete old images

✔ Lower server bills. Images are among the most disk-eating resources, with a single picture often taking up 3 MB or more. This quickly sums up and fills the available space.

✔ Smaller and faster backups. Regular updates with old data quickly multiply the space needed for them.

✔ Lower chance of hitting a server file limit, which is very common for many hosting companies, even if they don’t share this publically.

✔ Easier navigation in the media library since there is less clutter and distraction. You quicker find up-to-date images and reuse them rather then picking orphaned ones.

Delete unused images with Image Source Control

Show a list of unused images in the WordPress dashboard.

✔ List all unused images in one place

✔ Check images in content, options, and metadata

✔ Delete unused images in bulk

✔ Calculate resources blocked by unused images

✔ Stores Deep Check results for later review

✔ Filter the list for unchecked and unused images

Why you need a WordPress plugin to delete unused images

WordPress does not keep track of where an image is used. It only stores to which post an image was originally uploaded to, but not, if it is still used within that post. The “Uploaded to” information is unreliable.

The only way to delete unused images from the media library without a plugin is by using SQL queries. Just writing and testing these queries will take experienced developers several hours because they need to look for image URLs in various formats and image IDs, distinguish between image IDs that are random numbers or array keys, look for information in options and metadata, and consider any plugin you ever used and how they stored their information.

This query must then run for every probably unused image in the media library.

Delete not-used images with the WordPress plugin Image Source Control — even if you aren’t a developer!

FAQ

How to delete unused images in WordPress?

The most reliable way to delete unused images in WordPress is to run a deep check using Image Source Control for any image in the Media Library that is not referenced in the content of posts, options, or other meta data. Then you can bulk-delete all checked images to clean up your media library.

Can I check and delete unused images in bulk?

Yes. Just mark all relevant images, or simply all images on the page with one click, and then choose your appropriate action from the bulk options.

Where does Image Source Control look for unused images?

Image Source Control checks if an image is used as a featured image, the actual usage within the content of posts and pages, post meta, and options. It searches for the image URL and attachment ID.

Where does WordPress store deleted images?

WordPress doesn’t have a Trash for deleted unused images. Therefore, we show a confirmation message before deleting anything, and this never happens automatically, either. If you accidentally delete unused images, then use a recent backup. Ask your hosting provider if you don’t have a recent one.