Remove non-used images
3 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: February 3, 2016 (RSS)
By Toledoh - February 3, 2016
Hi Guys.
I've got a few websites that have a huge amount of uploaded images... real-estate sites mainly. For instance, one client runs auctions. They upload a few thousand images for each auction, then delete the record once the auction is complete. but this leaves the thousands of images on the server, and no easy way to remove them.
Is there a plugin that could somehow search the cmsb/uploads folder and see if there are any records that use each image - and if not, delete them?
Tim (toledoh.com.au)
By Damon - February 3, 2016
Hi Tim,
Uploaded images should be deleted when the record they are attached to is deleted. There should be no orphan uploaded files.
I tested with a local installation that if a record with uploaded files (either through upload field or WYSIWYG editor) is deleted, the uploaded files are deleted too.
Can you confirm that deleting a record doesn't delete the attached uploads? And is this something that happens consistently?
First step is to make sure the images are deleting when the record is deleted. Then after that is resolved, we can look at the issue of orphaned uploads.
Damon Edis - interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
By Toledoh - February 3, 2016
Hey Damon - I didn't realise that!
I just checked and the reason the images are not being deleted is that they are actually separate records from a related table. I've just advised the client that if they delete those records, the images will be removed. Thanks!
Tim (toledoh.com.au)