I’m setting up my starter/blueprint site, I’m trying to get my image resizing right, including for Woocommerce.
I have very limited PHP knowledge.
When I was using Elementor, I used this snippet to disable WP scaling of massive images (because I use Shortpixel to do this) and to disable the large 2 WP resizes;
function remove_default_image_sizes( $sizes) {
unset( $sizes['1536x1536']);
unset( $sizes['2048x2048']);
return $sizes;
}
add_filter('intermediate_image_sizes_advanced', 'remove_default_image_sizes');
add_filter( 'big_image_size_threshold', '__return_false' );
I’ve also enabled the Bricks ‘Generate custom image sizes’, which I understand adds these;
add_image_size( ‘bricks_large_16x9’, 1200, 675, true );
add_image_size( ‘bricks_large’, 1200, 9999 );
add_image_size( ‘bricks_large_square’, 1200, 1200, true );
add_image_size( ‘bricks_medium’, 600, 9999 );
add_image_size( ‘bricks_medium_square’, 600, 600, true );
- Is it recommended to remove the 3 core WP image sizes (or maybe leave Thumbnail and remove WP medium and large)?
- Does anyone have an uber snippet that does all this? I.E. Ends up with a good standard set of image sizes (for modern devices), without any duplicate/wasted sizes.