Keep a Clean WordPress Uploads Folder by Deleting Unused Images
If you want to keep a clean uploads folder, from time to time you’ll want to delete all of your unused images.
Media Cleaner analyzes the media entries used on your site, plugins, and themes, and lists unused media files in a separate dashboard. You can then opt to delete these files individually and they will be moved to the plugin’s internal trash, allowing you to retrieve these or delete them permanently.
DNUI (Delete Not Used Image) is another plugin you can use to clean out your unused images. This plugin will search for images on your database and tell you if the image is being used. If not, you have the option to delete some or all of these files.
Note: The plugin page on WordPress.org states that “This plugin hasn’t been tested with the latest 3 major releases of WordPress. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.” However, we recently tested it on a WordPress site with version 5.3 installed (December 2019) and the plugin worked fine.
To avoid losing or deleting important files, please make a full backup of your site, read the plugin documentation carefully, and make sure to configure all settings correctly before modifying or deleting your files.
Another option for dealing with unused images is to delete unused thumbnail images from your site’s wp-content uploads folder and keep only the thumbnails that are being used.
Finally, if you want to proactively manage images on your WordPress site, we recommend installing and configuring the Smush plugin. Smush will automatically resize, optimize, and compress all images uploaded to your site to ensure their optimal efficiency. Also, make sure to read our Ultimate Guide To WordPress Image Optimization.
Free up some of your disk space on your WordPress installations by beginning a new habit of cleaning your uploads folders.