Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1217387

    Hi,

    I’ve many website with enfold and all are the same problem too much space on ftp with diffrent image size.
    I’ve found and read many post on forum here :

    and
    https://kriesi.at/support/topic/how-can-i-delete-all-enfold-image-sizes/
    are the best for me.
    BUT :)
    How to remove this image size in functions.php child ?
    and just some size and not all the size.

    I’ve tested the plugin “Simple Image Sizes” but it doesn’t work for me…
    I’m surprised than kriesi don’t found a user friendly solution for his problem, it will be good ! :)

    #1219343

    Hey Luc,

    Thank you for the inquiry.

    How to remove this image size in functions.php child ?

    You can move the provided filter from the previous thread in the child theme’s functions.php file. And if you want to retain other sizes, just look for these lines:

    remove_image_size('magazine');
     remove_image_size('portfolio_small');
    

    The lines above disable the “magazine” and the “portfolio_small” thumbnail, so if you want to retain those thumbnails, you have to delete those lines.

    Best regards,
    Ismael

    #1251447

    Hi Ismael, I come back to this post several weeks later :). How do I declare the function in the child theme?
    there is a precise syntax for overlaying the native function I guess?

    • This reply was modified 4 years, 1 month ago by Luc.
    #1251703

    Hi,

    Thank you for the update.

    We can use the syntax above in the child theme, or wrap it inside an action hook like init or after_setup_theme so that the code is actually executed after the functions.php file has been loaded.

    add_action('after_setup_theme', function() {
       remove_image_size('magazine');
       remove_image_size('portfolio_small');
    }, 999);
    

    Best regards,
    Ismael

    #1262296

    Hi, thanks for this code, it’s perfectly what I need.
    Now I’m looking for remove all older thumbnails not used. Do you have a solution ? I’have 19 thumbnail for each file since many years^^, the upload folder make more 1Go. Do you have a solution ?
    I think the hardest part is identifying the images not used by WordPress …
    thanks

    • This reply was modified 3 years, 12 months ago by Luc.
    #1262893

    Hi,

    Thank you for the update.

    The unregistered thumbnails will be removed automatically when you regenerate the images. Please install one of the following plugins to regenerate the images. This process might take a while depending on the number of images uploaded in the media library.

    // https://wordpress.org/plugins/regenerate-thumbnails/
    // https://wordpress.org/plugins/simple-image-sizes/

    This process is safe but please do not forget to create a restore point or a site backup before regenerating the images in case something went wrong.

    Best regards,
    Ismael

    #1262894

    Hi,

    Thank you for the update.

    The unregistered thumbnails will be removed automatically when you regenerate the images using a plugin or a custom script, but we recommend installing an extension. This process might take a while depending on the number of images uploaded in the media library. Please check these plugins.

    // https://wordpress.org/plugins/regenerate-thumbnails/
    // https://wordpress.org/plugins/simple-image-sizes/

    This process is safe but please do not forget to create a restore point or a site backup before regenerating the images in case something went wrong.

    Best regards,
    Ismael

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.