0

I am using following code to prevent WordPress from creating some un required image sizes for my theme and only upload the original size

add_filter( 'intermediate_image_sizes_advanced', 'prefix_remove_default_images' );
function prefix_remove_default_images( $sizes ) {
 unset( $sizes['small']); // 150px
 unset( $sizes['medium']); // 300px
 unset( $sizes['large']); // 1024px
 unset( $sizes['medium_large']); // 768px
 return $sizes;
}

The code is somehow working and I am able to upload the original size but as you can see WordPress still generating 150x150 size images

enter image description here

As you can see I explicitly added unset( $sizes['small']); to the code, but this is still happening! Can you please let me know what I am missing here?

1 Answer 1

2

That's because there is no image size called small in WordPress. It's possible your theme registered it but the thumbnail size WordPress uses internally at 150x150 is named thumbnail not small

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.