Archived topic
image sizes
3 replies · Started by Marco on May 5, 2019
Hello
I'm just in the process of regenerating my thumbnails I I have a size like 768x419 - any idea where that's coming from - I've not set that in the media settings - anyway to get rid of that size?
Thanks
I believe that size is generated by srcset: https://make.wordpress.org/core/2015/11/10/responsive-images-in-wordpress-4-4/
Typically it's a good thing, but it is possible to disable: https://wordpress.stackexchange.com/a/211985
Thanks Tom
Actually this does the trick:
/* Media: remove default image sizes
---------------------------------------------------------------------------- */
function themeprefix_remove_default_images( $sizes ) {
//unset( $sizes['small']); // 150px
//unset( $sizes['medium']); // 300px
unset( $sizes['medium_large']); // 768px
//unset( $sizes['large']); // 1024px
return $sizes;
}
add_filter( 'intermediate_image_sizes_advanced', 'themeprefix_remove_default_images' );
Awesome! Thanks for posting your code :)