Delete unused images
This topic contains 27 replies, has 4 voices, and was last updated by Kiran 4 years, 11 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
March 20, 2020 at 1:09 pm #535840
I upload image.jpg and 15 extra images are created and GD is saving them for nothing.
Those 15 images are created by WordPress uploader not by GD. GD does not has own uploader. GD just saves images with image meta(image types in serialized form) in GD attachment tables when data returned from uploader.
1- And GD does not have them in the database even if I delete them?
Separate image type date is saved in meta of main image. So deleting image type from folder will not delete data from meta.
2- So I have to go to the FTP and delete 50,000 images one by one ?
This is only possible way for now. Not sure if any third party plugin available to delete image type only.
Kiran
March 20, 2020 at 1:13 pm #535842Separate image type date is saved in meta of main image. So deleting image type from folder will not delete data from meta.
And that meta how can be deleted?
This is only possible way for now. Not sure if any third party plugin available to delete image type only.
Plugins work perfectly with library media, but as GD hides that, none of them work.
Having to go manually to delete 50,000 images because GD don’t let you manage anything and hides all, is not good.
You should implement a way to manage this, I have over 10GB of files for nothing. Stored in database and in FTP. Just because GD saves it and that’s it.
And now I will have to spend days fixing the problem GD has.
Thanks.
March 20, 2020 at 1:45 pm #535848This reply has been marked as private.March 23, 2020 at 10:27 am #536234This reply has been marked as private.March 24, 2020 at 2:03 pm #536489Hello,
Try PHP snippet provided at here.
https://gist.github.com/kprajapatii/9770fab5bdd3abc59a5dc76484335eb5
Take backup before executing backup.
Thanks,
KiranMarch 25, 2020 at 8:22 am #536672Hello.
Which images will be deleted?
image-02-36×36.jpg
image-02-80×80.jpg
image-02-120×120.jpg
image-02-180×180.jpg
image-02-260×185.jpg
image-02-300×200.jpg
image-02-450×300.jpg
image-02-450×450.jpg
image-02-495×400.jpg
image-02-705×470.jpg
image-02-710×375.jpg
image-02-768×512.jpg
image-02-845×321.jpg
image-02-845×684.jpg
image-02-1030×687.jpg
image-02-1200×423.jpg
image-02-1200×430.jpg
image-02-1200×630.jpg
image-02.jpgWill this remove it from GD and from FTP?
This PHP works with any Enfold + GD site?
Thank you.
March 25, 2020 at 8:34 am #536674I just tried it and nothing happens. Everything exactly the same.
All code is shown in the PHP, so something is not correct.
Thanks.
March 25, 2020 at 8:36 am #536675This reply has been marked as private.March 25, 2020 at 9:38 am #536686This reply has been marked as private.March 25, 2020 at 10:42 am #536693This reply has been marked as private.March 25, 2020 at 10:48 am #536697Refer this page to check how to use PHP snippet https://wpgeodirectory.com/docs/useful-plugins/#snippets
Kiran
March 25, 2020 at 11:04 am #536698It seems it worked. Thank you!
I now have 6 sizes instead of 15.
Questions.
1- Are those 6 sizes needed?
image-02-80×80.jpg
image-02-300×200.jpg
image-02-768×512.jpg
image-02-1030×687.jpg
image-02-1200×630.jpg
image-02.jpgWhy not define 1 size to use and that’s it?
2- If I disable images for upload with Simple Image Sizes plugin, I assume those will not be created next time a place is published.
Correct?3- Which are the correct (best) sizes to use?
So I can disable everything else.4- Can I use this in another site and everything will work the same?
Again, thank you for your help.
March 25, 2020 at 12:11 pm #536717Hello,
Why not define 1 size to use and that’s it?
WordPress uses different image size to display based on purpose of display. Ex: icon, thumbnail, medium, original etc.
To remove any image(Ex: image-02-1200×630.jpg) you first need to find which image size has generated that image. The you have to add image size name in a list in PHP snippet.===
2- If I disable images for upload with Simple Image Sizes plugin, I assume those will not be created next time a place is published.
Correct?If image sizes disabled at the upload process time then it will not generate those image sizes.
===
3- Which are the correct (best) sizes to use?
So I can disable everything else.It depends on plugin functionality. Ex: WooCommerce, Enfold has own image sizes based own usage for customization.
Each custom image size added by plugin or theme has some usage for it. For GD you can disable image sizes other then WordPress default.===
4- Can I use this in another site and everything will work the same?
This snippet will work on all size where GeoDirectory is installed. But take backup first other to prevent any loosing data.
Kiran
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket