In last article, I shared a nice little trick to add custom image sizes to WordPress media uploader. In this article, I’ll share another trick to remove default image sizes from WordPress with another small snippet.
By default, WordPress will convert images to three sizes, which are given below:
- Thumbnail
- Medium Size
- Large Size
If you don’t want to use any of these image sizes then you can remove these sizes from being used by using the intermediate_image_sizes_advanced filter.
Just add the following snippet in your current theme’s functions.php file:
function trickspanda_remove_default_image_sizes( $sizes) { unset( $sizes['thumbnail']); unset( $sizes['medium']); unset( $sizes['large']); return $sizes; } add_filter('intermediate_image_sizes_advanced', 'trickspanda_remove_default_image_sizes');