This post is for DNUI version 1.4 working in WordPress 4.0
What is DNUI
Delete Not Used image is one wordpress plugin that will help you to find all image that they aren’t in use in any wordpress post or page, this will explain better after.
Whey you one to delete unused image? Well when you upload one image to wordpress, this one will make 4 childrens size of the original one, so you will have 5 image for one upload, you probably will use one one or two size for show the image, so the others 3 sizes will stay in your server doing nothing, well yes doing space in your server, and if you dont have a lots of space you will arrive to miss space for upload more image.
WordPress doesn’t have the option to delete sizes, you only can delete all the image with all sizes. So this plugin will find all the image that aren’t use in your wordpress site.
When you upload one image to your wordpress site, this one will be attached to post or page that you make the upload or if you use the uploader without any post this will be attached to the last one post made. And when you put the image in the post all, you will have some img url in the text, something like this
<a href=”http://www.nicearma.com/wp-content/uploads/2014/07/facebook-conexiones-21.png”><img class=”aligncenter size-medium wp-image-2968″ src=”http://www.nicearma.com/wp-content/uploads/2014/07/facebook-conexiones-21-600×554.png” alt=”facebook conexiones 2″ width=”600″ height=”554″ /></a>
If you see i have the original image facebook-conexiones-21.png and facebook-conexiones-21-600×554.png the medium size 600×554, the plugin DNUI will get all the image and try to find the match between the wordpress upload database and all post/page made, if any match is found the plugin will think that the image or sizes are not used, so you can delete.
And what happen if you use wordpress for another think that make post or page, well this plugin can fail, because you install some plugins that change the base of wodpress work, but don’t worry you have one option that will help you to make the plugin work anyway.
Understand the plugin
You have 3 menu parts
This will show you all the image that are or not used in your wordpress site, if is used you will have not the rights to delete the size used and neither the original image, you can delete all the not used image and if all size and the original size is unused you will have the rights to delete alls of then.
You can configure the plugin to make some backups of all image deleted by this plugin, but is a very simple logic and is not for extend use, if you want a very powerfull backup logic you can use another plugin before of use this plugin. (i can improve the backup logic, but i not very motivate at this moment for do it)
One of the more important part of this plugin, all configuration will made here (all change will be save automatically).
I will put more information about this part latter
- Make a save (Backup) of your database and your file (especially the uploads folder), because the code have to update the database and delete files and that is irreversible, so if something goes wrong is better have a backup.
- Performs tests on any page other than your own default, but having the same characteristics, since I have not tested for compatibility with other plugin, so you can see if will work fine.
- For do test, activate the option backup of the plugin, this will helps if something goes wrong to restore the image and row of the database changed.
- Download this plugin only wordpress.org.
- Upload the zip file from the plugin interface of wordpress
- Or upload the the folder from the unzipped dnui.zip to the folder of wp-content\plugins
- Make sure if you use the backup option that PHP can write in the backup file of the plugin.
Why the name
Well the last explication will be the name Delete Not Used image, you maybe you will ask why not Delete Unused Image, well the problem was, that the first version of this one was a remake of one plugin took of the web DUI, so make a remake and put the same name was not a very good idea. And i pick this name because i’m from some Spanish country, i live in France so i speak all the time french and if i use the same logic of this last 2 language the name will be similar. But at this moment i see a lots of plugin like this one but with somes better names like cleanup image wordpress, clean image, clean image upload, but are the same that mine.