WORDPRESS - Disable multiple image sizes

WordPress – Disable multiple image sizes

If you are using WordPress, you will notice that when you upload an image media, it creates multiple images of different resolutions. In this article, I will show you how you can disable multiple image sizes on WordPress.

Open your active theme’s functions.php file. It will be in “wp-content/themes/{your_active_theme_name}/functions.php”. Then add the following 2 hooks at the top of functions.php file:

function wpb_remove_image_sizes($sizes) {
    unset($sizes['thumbnail']);
    unset($sizes['medium']);
    unset($sizes['medium_large']);
    unset($sizes['large']);
    return $sizes;
}
add_filter('intermediate_image_sizes_advanced', 'wpb_remove_image_sizes');

function wpb_stop_generate_media_sizes($sizes) {
    return array();
}
add_filter('intermediate_image_sizes', 'wpb_stop_generate_media_sizes');

Refresh the page and try uploading a new image. You will now see that it will be uploaded just once. Let me know if you face any problem in this.