Delete unused images

This topic contains 27 replies, has 4 voices, and was last updated by  Kiran 4 years, 1 month ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #535412

    P O
    Expired Member
    Post count: 501

    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.

    #535414

    Guust
    Moderator
    Post count: 29970

    As 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

    #535415

    P O
    Expired Member
    Post count: 501

    There 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.

    #535752

    P O
    Expired Member
    Post count: 501

    Anything about this?

    I really need to empty the extra GB that GD is keeping there for nothing.

    Thanks.

    #535765

    Guust
    Moderator
    Post count: 29970

    I reminded the developers to have a look at your question.
    Sorry for the delay.

    #535793

    Naveen Giri
    Moderator
    Post count: 1559

    Hi 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 Experts

    If you want to delete unused images. you can follow this article.
    https://wpengine.com/resources/wordpress-media-library-clean-up/

    Thanks

    #535808

    P O
    Expired Member
    Post count: 501

    Hello 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.

    #535812

    Naveen Giri
    Moderator
    Post count: 1559

    GD 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

    #535814

    P O
    Expired Member
    Post count: 501

    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.

    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.

    #535827

    Kiran
    Moderator
    Post count: 7069

    Hi 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,
    Kiran

    #535829

    P O
    Expired Member
    Post count: 501

    How can I delete all unused images?

    Not Used Images.

    Thanks.

    #535830

    Kiran
    Moderator
    Post count: 7069

    It 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

    #535831

    P O
    Expired Member
    Post count: 501

    I 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.jpg

    Knowing which are the ones not used and stored by GD, how can I delete all unused images?

    Thanks.

    #535833

    Kiran
    Moderator
    Post count: 7069

    I 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

    #535835

    P O
    Expired Member
    Post count: 501

    I 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.

Viewing 15 posts - 1 through 15 (of 28 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket