WordPress Templates are usually designed to create multiple thumbnail sizes whenever an image is uploaded; yet these images may not actually be used on your website.
In this article, I would like to show you one useful plugins that allow you to remove unused images and unreferenced images from your website.
1. BackUp Your WordPress
Due to the nature of these plugins, I highly recommend you back up your database and your WordPress uploads folder. This will allow you to restore your website in the event of a plugin deleting images that were actually being used on your website.
Image Cleanup scans your website for unreferenced images. These are images that have been uploaded to your website but are not indexed by your database or referenced by posts or plugins.
Image Cleanup will index these (and many more) unreferenced images. Unreferenced images are not indexed in the wordpress database and also not used by posts, scripts or backup restore meta data. Please note that images which have valid database metadata but are not used in posts are not indexed at this time. This is beyond the scope of this plugin.
Image Cleanup will also find images without meta data and images with incorrect meta data.
- Save space taken up by unreferenced/backup images!
- Fix incorrect metadata (sizes)
- Bulk repair/delete functionality
- Pagination for extremely large result sets
- Logs tabs easily visible for reviewing!
- Detailed information in log tabs!
- Full restore functionality!
- Especially useful for developers!
- Written as class to avoid any conflicts!
- Highly configurable to avoid memory and/or timeouts on some setups
2. How to use?
The main plugin page allows you to change the number of images and posts to process in each step. Images can be skipped from the scan if you specify the folder or absolute path of the images.
The plugin will show useful information for valid image attachments such as filename, dimensions, meta ID, and image path. You can also see images without meta details that are being used. No actions can be performed for used images. The information simply lets you see a summary of the images that are being used on your website.
Checkboxes will appears next to unused images. You can check the list of images and look at which ones should be deleted. In my test website, I found most unused and obsolete images to be automatically generated thumbnails.
Simply select the images you want and move them or delete them. The checkbox at the top of the page allows you to select all images.