Turning off automatic scaling of large images in WordPress

While I was uploading posts of my work recently, I noticed that the larger images had been scaled down. Some of the screenshots of my sites are very tall, and the scaling being applied due to exceeding the maximum height had quite a dramatic affect on the width.

It turned out that this behaviour was added in version 5.3. Images with a height or width exceeding 2650px would be proportionally scaled down.

In some ways this is an understandable change, as optimised images are normally a good thing. However, I think this should be made a clearer option when setting up WordPress.

The process WordPress uses of generating multiple sizes from the original image should provide enough flexibility, as it is possible to select which version to insert when adding media in WordPress.

There might be a benefit to some users not using up their hosting storage as quickly when uploading unoptimised images, but WordPress appeared to still be keeping the original image anyway. As you can see, there is a link provided in the media library.

For my work posts I specifically want the images to load in at high resolution so that people have the option to open the images in a new tab and see the sites at a size similar to the browsing experience.

I am sacrificing some performance and adding to page loads to do this, but in this specific context I am happy for that to be the case.

My recommendation would be to turn this feature off and instead make sure that you spend some time to set up your generated image sizes as needed. Then in your posts (or templates you are developing for your clients) call in the preferred optimised size.

To turn the automatic scaling off in WordPress (version 5.3 and above):

add_filter( 'big_image_size_threshold', '__return_false' );

There are various ways to control the size of the images being loaded into your WordPress templates. For example if you’re using the post thumbnail and want to display the medium version that was generated on upload:


If you are using ACF (Advanced Custom Fields) to create custom image fields in your templates you can also select the size being returned:

$image = get_field('image');
$size = 'medium'; // (thumbnail, medium, large, full or custom size)
if( $image ) {
    echo wp_get_attachment_image( $image, $size );

Note, the example above requires returning the image ID. There are further examples from ACF on how to set the size of images when using other return formats, such as an image array.

Leave a Reply

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