This Page is for DNUI version 1.5.4 working in WordPress 4.0
You can help me to work in this plugin, buy me a good dinner with my girlfriend if she happy she will let me work the weekend in this plugin:
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.
Why 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 (maybe more or less than 4), so you will have 5 image for one upload, you probably will use one or two size for show the image, so the others 3 sizes will stay in your server doing nothing, well not nothing, they will be occupy space in your server and database, so if you dont have a lots of space in your server and database, you will arrive to have problem with the server and database space.
WordPress doesn’t have the option to delete sizes, you only can delete all the image with all sizes, if and only if you dont use any of the original and sizes of one image. 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/page that you make the upload or if you use the uploader without any post/page, this will be attached to the last one post made. When you put this image in the post/page, 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
So the plugin DNUI will get all the images from the database and try to find the match between then 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 have the option to delete it.
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.
You will have the rights to delete:
- Delete the original, if this one and the other size unused or the size aren’t in the ignore size option
- Delete any size if this one is unused and the size is not selected in the ignore size option
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, this is irreversible, so if something goes wrong is better have a backup.
- Performs tests on any site other than your own default, but having the same characteristics, since i have not tested the compatibility with others plugins, so you will see if it is working fine.
- Make the same test in your production site.
- 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.
The easy way:
- Install the plugin direct from your site and the plugin admin area
The hard way:
- Donwload the .zip file from wordpress.org
- Upload the zip file from your wordpress plugin area.
- 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.