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

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

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

Leave a Reply

Your email address will not be published.