Naveed Anjum
+92 313 514 6669

Remove WordPress Default Image Sizes

WordPress image sizes contain defaults, smallmedium and large, and medium-large which are used in their implementation of responsive images. You can remove these default images with a WordPress filter intermediate_image_sizes_advanced

add_filter( 'intermediate_image_sizes_advanced', 'naveed_remove_default_images' );
// Remove default image sizes. 
function naveed_remove_default_images( $sizes ) {
 unset( $sizes['small']); // 150px
 unset( $sizes['medium']); // 300px
 unset( $sizes['large']); // 1024px
 unset( $sizes['medium_large']); // 768px
 return $sizes;

So just unset the image sizes you want, but for new images uploaded they will only take on the sizes which remain set by the filter.

Next Post

Leave a Reply

Your email address will not be published. Required fields are marked *