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 16, 2020 at 12:35 pm #535412
I have a problem with images and I am not able to delete them.
Enfold theme generates different image sizes when a new post is made. This happens when a new place is published as well.
I need to delete all extra sizes not needed, because I have 10 GB just because of that extra images.
I can use Simple Image Sizes plugin and Regenerate Thumbnails plugins to do the task, the problem is that this only affects Featured Images, because GD hides all other existing images and those are not present in the library or registered anywhere.
So, if I disable 8 sizes using Simple Image Sizes plugin.
How can I delete them?
Thanks.
March 16, 2020 at 12:47 pm #535414As far as I understand it, all sizes may be used to speed up delivery of pages, so you should not delete any images.
If images are deleted from a listing, all versions will be automatically deleted too.I’ll get the developers to confirm.
Thanks
March 16, 2020 at 12:51 pm #535415There are 15 image sizes per image.
1 place with 20 images = 300 images.
200 places = 60,000 images.I don’t need that, I need 3 sizes only, everything else needs to be deleted.
Enfold creates images for portfolio, gallery, masonry, magazine, and so on.
Why is GD saving that sizes if those will never in life be used?
So I need to delete all unused images, please let me know how.
Thanks.
March 19, 2020 at 4:28 pm #535752Anything about this?
I really need to empty the extra GB that GD is keeping there for nothing.
Thanks.
March 19, 2020 at 10:59 pm #535765I reminded the developers to have a look at your question.
Sorry for the delay.March 20, 2020 at 7:04 am #535793Hi P O,
In WordPress we define sizes using add_image_size function. Generally, images sizes are defined in the theme function.php
https://developer.wordpress.org/reference/functions/add_image_size/This function itself does not have any check for the post type.
So if a size got added using it. It will be applicable to all the uploaded images on WordPress.If you want to completely disable a few image sizes for specific post types.
You can search for the following code: add_image_size and/or set_post_thumbnail_size and comment it. Since its a customization. You can look for our GD ExpertsIf you want to delete unused images. you can follow this article.
https://wpengine.com/resources/wordpress-media-library-clean-up/Thanks
March 20, 2020 at 10:09 am #535808Hello Naveen.
In WordPress we define sizes using add_image_size function. Generally, images sizes are defined in the theme function.php
https://developer.wordpress.org/reference/functions/add_image_size/This function itself does not have any check for the post type.
So if a size got added using it. It will be applicable to all the uploaded images on WordPress.Yes, that is what I said the problem is.
Enfold theme generates different image sizes when a new post is made. This happens when a new place is published as well.
Enfold creates images for portfolio, gallery, masonry, magazine, and so on.
Why is GD saving that sizes if those will never in life be used?
And
If you want to delete unused images. you can follow this article.
https://wpengine.com/resources/wordpress-media-library-clean-up/Also I already said:
I can use Simple Image Sizes plugin and Regenerate Thumbnails plugins to do the task, the problem is that this only affects Featured Images, because GD hides all other existing images and those are not present in the library or registered anywhere.
So, if I disable 8 sizes using Simple Image Sizes plugin.
How can I delete them?
So we both said the same and the problem is:
GD is saving images for portfolio, magazine, accordions, gallery, masonry and so on.
Those images will never be used, GD is storing them itself without access to them.
As there is no access to them, you can’t clean the library, because the images are not there.
Please let me know how to delete all unused images.
Thanks.
March 20, 2020 at 10:20 am #535812GD is saving images for portfolio, magazine, accordions, gallery, masonry and so on.
If ( portfolio, magazine, accordions, gallery, masonry ) images sizes are defined in WordPress. every new post image will get cropped in those sizes.
there is an only possible way to not allow those images from creation is to remove the add_image_size() function call for those sizes.Those images will never be used, GD is storing them itself without access to them.
As there is no access to them, you can’t clean the library, because the images are not there.
How you found that GD storing it without any public access?
Could you please also share FTP and Site details so we can check it from our side?Thanks
March 20, 2020 at 10:25 am #535814If ( portfolio, magazine, accordions, gallery, masonry ) images sizes are defined in WordPress. every new post image will get cropped in those sizes.
there is an only possible way to not allow those images from creation is to remove the add_image_size() function call for those sizes.Why is GD saving 15 image sizes it will never use?
How can I delete all unused images?How you found that GD storing it without any public access?
Just publish a place with 40 images, go to library and just the featured one is there.
The other 39 are not, so you can’t clean the library.
How can I delete all unused images?
Could you also share FTP and Site details so we can check it from our side?
What for? The problem is clearly explained.
Thanks.
March 20, 2020 at 11:49 am #535827Hi There,
Why is GD saving 15 image sizes it will never use?
How can I delete all unused images?GD uses WordPress standard upload function to upload images/files. These image sizes are generated by WordPress upload function. In WordPress it is hard to decide file uploaded under /uploads/ directory is unused, because almost all plugins, themes uses this directory to store images including WordPress media library. From WordPress media it allows to assign one image to many posts.
===
Just publish a place with 40 images, go to library and just the featured one is there.
The other 39 are not, so you can’t clean the library.
How can I delete all unused images?
That entry for featured attachment saved in posts standard table so it shows entry in media lists. Rest of images are uploaded in same directory that featured image uploaded. The difference is non featured image entries are saved in GD own attachments table.
Images uploaded under GD listings can be deleted from listing edit page(you can see delete button on hovering image). Deleting listing also deletes images/files assigned to that listing.
Let us know.
Thanks,
KiranMarch 20, 2020 at 11:51 am #535829How can I delete all unused images?
Not Used Images.
Thanks.
March 20, 2020 at 12:04 pm #535830It is not possible without checking manually that image is used or unused. Only possible way is to check each image manually and delete manually if it is found unused.
Kiran
March 20, 2020 at 12:08 pm #535831I know the normal image is used.
image.jpg
Not used and stored by GD in their own table, not accesible and for nothing but consuming space:
image-200×200.jpg
image-300×300.jpg
image-800×300.jpg
image-1600×900.jpg
image-100×200.jpg
image-400×600.jpg
image-900×300.jpg
image-500×500.jpgKnowing which are the ones not used and stored by GD, how can I delete all unused images?
Thanks.
March 20, 2020 at 12:28 pm #535833I think you are saying about unused image types. Unused image & unused image are different. Image does not has separate entry for each image type. Only one way to delete those “image types” is to delete it manually from folder.
Kiran
March 20, 2020 at 12:35 pm #535835I think you are saying about unused image types. Unused image & unused image are different.
I am saying what is above.
I upload image.jpg and 15 extra images are created and GD is saving them for nothing.
Only one way to delete those “image types” is to delete it manually from folder.
1- And GD does not have them in the database even if I delete them?
2- So I have to go to the FTP and delete 50,000 images one by one ?
Thanks.
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket