How to Disable Large Image Scaling in WordPress? You might notice that when you add a big picture to your WordPress website, the file name might end with “-scaled.jpg.” This is because WordPress automatically makes these big images smaller to make your site faster. In WordPress 5.3, they started doing this for images larger than 2560 pixels on the longest side.
So, if you put a picture that’s 5000 pixels by 3000 pixels, WordPress will make it 2560 pixels by 1536 pixels. This is good for most websites, especially for people who add big pictures without realizing how large they are. Since most visitors won’t need to see pictures that big, having WordPress make them smaller helps your site work better.
If you’re reading this, you might want to stop WordPress from automatically making these big pictures smaller.
Let’s find out how to do that and turn off the automatic resizing for large pictures in WordPress:
How to Disable Image Scaling in WordPress with PHP
If you want to use this code on your WordPress site, you can do so by using the Code Snippets plugin or by adding it to the “function.php” file of your site’s theme. This code will make sure that WordPress doesn’t automatically resize images by adjusting the “big_image_size_threshold” filter.
<?php // Disable WordPress' automatic image scaling feature add_filter( 'big_image_size_threshold', '__return_false' );
Once you include this piece of code on your website, your WordPress site won’t resize big images anymore. However, keep in mind that this change will only affect images you add in the future and won’t apply to images you’ve already uploaded.
Increase WordPress Image Scaling Threshold with PHP
If you want to make the resizing limit even bigger than 2560px, you can use this code. In the example below, I’ve set it to 4000px, but you can replace 4000 with any value that suits your website better.
<?php // Increase the image resize threshold to 4000px on the longest edge function da_big_image_size_threshold( $threshold ) { return 4000; } add_filter( 'big_image_size_threshold', 'da_big_image_size_threshold', 999, 1);
This is a good choice if you’re certain about the specific size that your website’s images should be.
How to Disable Image Scaling in WordPress with Plugin
Don’t know much about PHP? That’s okay! You can use the “Disable ‘BIG Image’ Threshold” plugin. This plugin does what the code snippet above does, which is to turn off the large image resizing limit.
Thank you for checking out our guide on turning off the WordPress image resize feature. If you have any questions about developing with WordPress, feel free to ask in the comments below.
Related Articles
Leave a Reply