How To Delete Unused Images WordPress Plugin DNUI tutorial shows you how to delete all those unused images that are saved to your website and added to your database.
Note: Before you begin this tutorial make sure you have created a backup using a plugin. Also you can create a backup using the plugin mentioned here.
Everyone knows when you start publishing blog post, add new pages, upload files i.e. images your Media files start growing rapidly. After a few years you could end up having more than 2000 images. For every image you upload WordPress adds other size images. So usually you end up with about 3 images or 4 images per uploaded image. Some of you might only use one image all the time, like the large size image when you insert it in a post or page. You also use the small icon size image that gets displayed in your Media -> Library area.
The following is something that most of us keep doing including myself. Every time you either delete an old post or update a post with different size images, you forget to delete the old images. This happens regularly so just imagine how many images you have that are obsolete in your Media -> Library?
In this post you will learn how to find those images that are no longer used and are safe to delete using a plugin. You can also delete the other size images that are created by WordPress which you know you will never use.
What you need:
How To Delete Unused Images WordPress Plugin DNUI Steps
Step 1 ) Before you begin setting up and using the plugin check the following settings in WordPress. Go to Settings -> Media and adjust the following settings. See image below.
- Thumbnail size = For the thumbnail size images you can select to crop the images.
- Medium size
- Large size
- You can also select to organize you uploaded images into month and year based folders.
- Make sure you click on Save Changes button after you complete your settings.
Step 2 ) When I uploaded the above image, 4 images were created with the following sizes. In your website it might be slightly different.
- 64 x 64
- 150 x 150
- 300 x 267
- Full size image which is what I used above 450 x 401
In the above sizes, you can safely delete all the sizes you don’t want to keep. For this post I am keeping the following sizes 64 x 64 which is used to display the small size image while viewing the Media images. The full size image because that is the image used in this tutorial 450 x 401. The other two images 150 x 150 and 300 x 267, I can safely delete because they won’t be used. (In your case you might be using these images for your Featured Image and or for other purposes that might be linked to your theme or a plugin.)
Step 3 ) The following image Media -> Library, shows you the image attached to the following post How To Delete Unused Images WordPress Plugin DNUI. This tells you that you should not delete this image because if you do then the blog post will be missing an image. And this would look very ugly and un professional. This is why on a regular basis you should check your site for broken links. You might like to read the following tutorial WordPress Broken Links.
This is another method you can use to check all your Media uploaded images to see if they are attached or not. However when you have more than 500 plus images it will become very challenging to monitor and check. That is when this plugin DNUI comes in handy. It will save you a lot of hours and possibly a headache.
Step 4 ) After you install the plugin DNUI, go to the following area Tools -> DNUI Delete not used image to set up the plugin. The plugin comes with 4 tabs in the menu.
Start setting up the plugin to your needs. It is very straight forward that is why I am not going to go into the setup details in this tutorial.
Note: As I mentioned above, please create a backup before you start deleting images. Make sure you have set up the plugin correctly under options.
To make your life much easier the plugin comes with a setting that will help you even further, Ignore size list. Enable this option and make sure you select all the images sizes you will be using in your website and you want to keep.
That is how simple it is to delete all unused images and keep your website light and your database clean.
I will be updating this post from time to time. So keep coming back for more. If you have any questions please let me know.