Image size advice

Hi, I don’t know if this is a theme issue or not, but when I upload an image with this theme installed I’m getting multiple image sizes, not just the default WP small, medium & large image sizes. I’m getting at least 9 different sizes plus the original. Are these extra sizes used for anything? The thing is many of these images are completely useless because they are landscape while the original pictures are portrait.

Can you please advise how I can stop these extra image sizes from being generated as they are just clogging up the server. Thanks.

This theme generates 4 different image sizes and you can find them defined in functions.php file like this.

	add_image_size( 'featured', 670, 300, true );
	add_image_size( 'featured-medium', 230, 230, true );
	add_image_size( 'slider', 1018, 460, true ); 		// used on Featured Slider on Homepage Header
	add_image_size( 'gallery', 474, 342, true ); 

If you don’t use some of these images sizes you can just uncomment those lines.
I don’t know from where the remaining images comes from but these are the ones generated by theme itself.

Thanks, I’ll have a look. I have Woocommerce installed with different settings, which I had to change because I was getting blurry images and that was a suggested solution, so that may be where more are coming from.

Sorry to be a pain, but I can’t get the theme to ignore any of these image sizes. Can you explain exactly how to remove them using the functions.php file in a child theme? Commenting them out there has no effect. I’m afraid I’m a coding novice.

To get it done via Child Theme you should use this filter

add_filter( 'intermediate_image_sizes_advanced', 'remove_parent_image_sizes' );

function remove_parent_image_sizes( $sizes ) {
    unset( $sizes['featured'] );
    unset( $sizes['slider'] );
    return $sizes;

As you can see from this example I have removed featured and slider image but you can do the same thing with other images as well by simply modifying this function.

Thank you very much, that worked a treat.