I'm building a theme in _S and using native Gutenberg blocks.

I have the following code via my functions.php file to set my image sizes:

add_theme_support( 'post-thumbnails' );
add_image_size( 'carousel', 1366, 550, true );
add_image_size( 'hero', 1366, 400, true );
add_image_size( 'large-square', 392, 340, true ); 
add_image_size( 'medium-square', 279, 314, true );
add_image_size( 'small-square', 215, 170, true );
add_image_size( 'diagram', 650 ); 
add_image_size( 'full-width', 884 ); 
add_image_size( 'half', 430 ); 
add_image_size( 'third', 279 ); 
add_image_size( 'quarter', 203 );

I also have this code to remove the default image sizes:

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

When adding new images or regenerating my thumbnails via WP CLI, there are a number of generated image sizes that appear and do not recognise:


I initially thought it could be down to the recent WordPress 5.3 update that introduced a new way to manage large images.

I tried adding this to functions.php:

add_filter( 'big_image_size_threshold', '__return_false' );

But I still get larger images that are scaled, like so:


Where could WordPress be getting these image sizes from? I'm running a single plugin for the build (ACF).


I found the culprit!

WordPress 5.3 introduced additional image sizes which can be found via /wp-includes/media.php.

Updating my function, like so, removed the extra sizes:

function remove_default_image_sizes( $sizes) {
    unset( $sizes['large']); // Added to remove 1024
    unset( $sizes['thumbnail']);
    unset( $sizes['medium']);
    unset( $sizes['medium_large']);
    unset( $sizes['1536x1536']);
    unset( $sizes['2048x2048']);
    return $sizes;
add_filter('intermediate_image_sizes_advanced', 'remove_default_image_sizes');

You could also remove those image sizes completely using remove_image_size (see: https://developer.wordpress.org/reference/functions/remove_image_size/)

Example (to be placed in your functions.php file):


This function, however, won't work for default WP image sizes (e.g. 'thumbnail', 'medium', 'large', etc.). There's a work-around though. Simply set the sizes to 0:

update_option( 'thumbnail_size_h', 0 );
update_option( 'thumbnail_size_w', 0 );
update_option( 'medium_size_h', 0 );
update_option( 'medium_size_w', 0 );
update_option( 'medium_large_size_w', 0 );
update_option( 'medium_large_size_h', 0 );
update_option( 'large_size_h', 0 );
update_option( 'large_size_w', 0 );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.