Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1431785

    Hi
    I tried several versions of code in functions.php in child , suggested in threads dealing with this issue but I’m still seeing multiple image file versions are created. It’s a clean wp install , enfold and no plugins.

      Are these created by Enfold or WP?
      How best to stop it?
      Does it make sense to work with a setup that stores a single image, as uploaded, and I’ll create my own versions for any content element as needed?
      If so where can I find a list of image sizes per content element?

    Screen-Shot-2024-01-23-at-14-45-21

    #1431789

    see: https://kriesi.at/support/topic/still-fighting-with-managing-default-image-sizes/#post-1418393

    or: https://kriesi.at/support/topic/bilder-speicher/#post-1422743

    Read the comments carefully in those snippets – some image-sizes are needed for backend to work.

    #1431800

    Ive used this code but still many images generated
    Screen-Shot-2024-01-23-at-17-12-11

    // Disable loads of Enfold & WP image sizes upon upload
    // do image sizes manually, double-size with high compression for retina screens
    // use Photoshop to set exact double size and quality between Q30 and Q40
    add_action('init', 'remove_enfold_image_sizes');
    function remove_enfold_image_sizes() {
    // do NOT remove widget size, is used in backend portfolio items!
    // remove_image_size('widget');
      remove_image_size('square');
      remove_image_size('featured');
      remove_image_size('featured_large');
      remove_image_size('portfolio');
      remove_image_size('portfolio_small');
      remove_image_size('gallery');
      remove_image_size('magazine');
      remove_image_size('masonry');
      remove_image_size('entry_without_sidebar');
      remove_image_size('entry_with_sidebar');
      remove_image_size('shop_thumbnail');
      remove_image_size('shop_catalog');
      remove_image_size('shop_single'); 
        remove_image_size('shop_gallery_thumbnail');
    }
    // Remove unneeded WP image sizes
    add_filter( 'intermediate_image_sizes_advanced', 'prefix_remove_default_images' );
    // Remove default image sizes here. 
    function prefix_remove_default_images( $sizes ) {
    // do NOT remove small and medium sizes, they are used in backend Media Library!
    // unset( $sizes['small']); // 150px
    // unset( $sizes['medium']); // 300px
     unset( $sizes['large']); // 1024px
     unset( $sizes['medium_large']); // 768px
     return $sizes;
    }
    
    • This reply was modified 9 months, 1 week ago by Yory.
    #1431821

    But : after erasing some of those image-sizes – you had to regenerate your thumbnails : there are some good plugins to do so.
    f.e.: https://wordpress.org/plugins/force-regenerate-thumbnails/

    #1431863

    Hi,

    Thank you for the inquiry.

    Have you tried regenerating the thumbnails? You can use the plugin suggested by @Guenni007 above or the plugin linked below.

    // https://wordpress.org/plugins/regenerate-thumbnails/

    Please make sure to create a site backup or restore point before regenerating the thumbnails just in case.

    Best regards,
    Ismael

    #1431869

    i guess i took the plugin above because some of those tools do not remove the already existing thumbnails.
    one plugin that is more clear in this is: https://en-gb.wordpress.org/plugins/regenerate-thumbnails-advanced/

    it has a clean-up function “Delete unused Thumbnails”

    #1431950

    Isn’t the code supposed to stop the automatic creation of multiple images some inflated in file size considerably?
    these regenrate plugins will do that or will they generate more images or both?

    #1431975

    The snippet above ensures that during the upload of new files, when creating the various file formats, some of the intended formats are no longer created.
    This does not affect existing file formats.
    For this you need these regenerate thumbnails plugins once to recalculate here and to remove file formats that no longer exist.
    After recalculating you can deinstall those plugins.

    #1432005

    Of course the snippet will not delete the 1000s of files already created and the regenerate-thumbnails-advanced does not delete anything it seems although the Advanced options for Delete Unselected Thumbnails and Remove non-existent images.
    what does recalculate mean? Selecting the desired file dimensions to regenerate by the plugin?
    WIll this potentially contradict the snippet code that restricts regeneration of many image sizes?

    #1432147

    please try : https://wordpress.org/plugins/force-regenerate-thumbnails/ as mentioned above – i guess this is the tool to recalculate all files by erasing the existing ones.

    But be carefull – if you have inserted on your content an image with an image-size that will be deleted – you then have no image in the frontend.

    #1432174

    or as mentioned above the plugin: https://en-gb.wordpress.org/plugins/regenerate-thumbnails-advanced/

    First: install the plugin. Start by deleting all calculated Image-sizes by:

    Second: enter the snippet to your child-theme functions.php and

    Third: go to that plugin again and recalculate the preserved image-sizes:

    #1432436

    for some reason no files are deleted by Regenerate Thumbnails Advanced
    used the same plugin options
    Regenerate Thumbnails Advanced

    • This reply was modified 9 months ago by Yory.
    #1432572

    Hi,

    Thank you for the update.

    Did you enable the “Delete Unselected Thumbnail” option? Again, please make sure to create a site backup before proceeding.

    Best regards,
    Ismael

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