how to remove unwanted image sizes from wordpress theme

Many times you do not need the many image sizes for wordpress. You need the original image only for your wordpress sites. Sometime you need the original and thumbanil image only. But many wordpress themes creates the multiple image version in your site which is not useful. Using following code you can remove the unwanted images while uploading the images.

Here in this article I going to show you, how we can remove unwanted image sizes from wordpress theme. Using code snippet, you can easily remove unwanted image sizes.

remove unwanted image sizes

You just need to add following code into functions.php file.

function wpapi_remove_image_size($sizes) {
                unset( $sizes['small'] );
                unset( $sizes['medium'] );
                unset( $sizes['large'] );
                return $sizes;
        }
add_filter('image_size_names_choose', 'wpapi_remove_image_size');
remove unwanted image sizes

remove unwanted image sizes

Add a Comment

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