Site logo

Archived topic

woocommerce generates thumbnails for everything

3 replies · Started by Halil on March 13, 2022

Viewing posts 1–4 of 4

Hi,
I've noticed that after installing woocommerce, 2 additional thumbails were added for every image in media library! I delibaretely disabled many thumbnail sizes and I wasnt expecting such behaviour. Is there any way to prevent this behaviour? I've changed setting in customizer to 0 for main image/thumbnail width, also chose "uncropped". I have no idea if these settings have anything to do with thumbnails.

Hi there,

Woocommerce doesn't document it - but I do believe that Setting those sizes to 0 should remove the image.
If not then you can try adding this snippet to remove the sizes that woo generates:

function sr_remove_woocommerce_image_sizes() {
    
    // Remove woocommerce copied sizes from default
    remove_image_size( 'woocommerce_thumbnail' );
    remove_image_size( 'woocommerce_single' );
    remove_image_size( 'woocommerce_gallery_thumbnail' );
    
}
add_action( 'init', 'sr_remove_woocommerce_image_sizes', 99 ); 

Code found here: https://stackoverflow.com/a/63643876

Note the comment, it won't remove existing images but will stop new ones being generated.

thanks a lot David,
if I knew that woo behaviour I wouldnt install it at all.

You're welcome

This archived topic is closed to new replies.