I have a theme that generates 11 different sized images for every image uploaded.
set_post_thumbnail_size( 220, 150, true);
add_image_size( 'redmag-blog-list', 491, 280, true);
add_image_size( 'redmag-blog-list-large', 614, 320, true);
add_image_size( 'redmag-sidebar', 100 ,100, true);
add_image_size( 'redmag-blog-grid', 496, 290, true);
add_image_size( 'redmag-blog-tran', 480 ,250, true);
add_image_size( 'redmag-blog-tran-vertical', 328 ,480, true);
add_image_size( 'redmag-blog-video',480,150,true);
add_image_size( 'redmag-mini-list', 150 ,100, true);
add_image_size( 'redmag-blog-tran-large', 770 ,420, true);
add_image_size( 'redmag-blog-vertical', 510 ,680, true);
add_image_size( 'redmag-related-image',370,247,true);
This is okay for the theme but it also resizes every image uploaded on Woocommerce which isn’t required and takes up a lot of space.
As a temporary measure, I comment out the above code while adding images to woocommerce so it doesn’t generate those images.
Can I disable the image generation for ONLY Woocommerce uploaded images?
3
Answers
You can try code below:
As far as I know (not sure if anything has changed) you can’t, image sizes are created when you add them via New Media, but I’m leaving that to someone better informed.
You may try some workarounds like the one below tested and working but not checked for conflicts:
This is the basic idea…
Try this: