You may notice when you upload a large image to your WordPress site the file will likely have “-scaled.jpg” at the end of the file. This is because WordPress will automatically scale large images to help speed up your site. WordPress 5.3 introduced image scaling for large images over 2560px on the longest edge.
This means if you upload a 5000px by 3000px it’ll be scaled down to 2560px by 1536px. This is great for most sites, especially for users who upload large files and may be unaware of how large the file is. Since most users visiting your site won’t need to view image files that large having WordPress set the maximum helps with performance.
If you’re reading this post you’ll likely want to disable the automatic large image scaling in WordPress.
Let’s dive in how to disable WordPress resizing for large images:
How to Disable Image Scaling in WordPress with PHP
To add this code snippet to your WordPress site you can use the Code Snippets plugin or add it to your site’s function.php file. This snippet will tell WordPress to disable its auto resize function via the big_image_size_threshold filter.
After adding this snippet to your site your WordPress site will no longer scale down large images. Note that this will only take affect forward and not to previous uploads.
Increase WordPress Image Scaling Threshold with PHP
If you’d like to just increase the resize threshold from 2560px to a higher resolution you can use this code snippet. In the example below I set it to 4000px but you can change 4000 to whatever value your site needs.
This is a great option if you know exactly what resolution your site’s images need to be.
How to Disable Image Scaling in WordPress with Plugin
Not familiar with PHP? No problem! You can use the Disable “BIG Image” Threshold plugin. This plugin basically adds the above snippet above to disable the large image resize threshold.
Thanks for reading our guide to disabling WordPress resize function. If you have any questions about WordPress development let us know in the comments below.