Hello, We have deleted 40k plus images from our site upload folder.
I also placed this code to our functions.php and in the WP setting we have set the sizes to zero
// disable generated image sizes
function shapeSpace_disable_image_sizes($sizes) {
unset($sizes['thumbnail']); // disable thumbnail size
unset($sizes['medium']); // disable medium size
unset($sizes['large']); // disable large size
unset($sizes['medium_large']); // disable medium-large size
unset($sizes['1536x1536']); // disable 2x medium-large size
unset($sizes['2048x2048']); // disable 2x large size
unset($sizes['150x150']);
unset($sizes['449x600']);
unset($sizes['567x483']);
unset($sizes['567x671']);
// Here I added custom sizes - but the generated size are not these sizes mostly
return $sizes;
}
add_action('intermediate_image_sizes_advanced', 'shapeSpace_disable_image_sizes');
// disable scaled image size
add_filter('big_image_size_threshold', '__return_false');
// disable other image sizes
function shapeSpace_disable_other_image_sizes() {
remove_image_size('post-thumbnail'); // disable images added via set_post_thumbnail_size()
remove_image_size('another-size'); // disable any other added image sizes
}
add_action('init', 'shapeSpace_disable_other_image_sizes');
This link is kinda connected to the issue. but it is not clear what happened there thats solved the issue
this are the sizes that generated
Can you help us how to disable auto gen images?