Disable Image Scaling in WordPress 5.3

December 17, 2019
Posted in General
December 17, 2019 Niall Flynn

WP 5.3 added a setup which auto scales larger images.

In typical WP form there are no options, this is now an imposed ‘rule’ defaulted in the CMS.

This is not needed and users should be allowed imo upload larger images, I also use other tools to take images offsite so WP interfering here is not good.

For image SEO this is also bad it also renames the images as it resizes it, which is not ideal. When you upload an image it should just upload this modification of the images you uplaoad is a plugin fucntion and is not advised in the core of your WP.

It is training bad behaviour too, images should generally be 1920×1080 at a max, but the CMS cannot act as the brain here. There are use cases for larger images. This similar to blocking of SVG uploading is not good for a simple work flow using WP.

To Remove This:

Copy the code below into your functions.php file:

add_filter( 'big_image_size_threshold', '__return_false' );

or use this plugin:

Disable "BIG Image" Threshold

To increase the limit

function dg_big_image_size_threshold( $threshold ) { return 10000; // change this to the px Value you want }
add_filter('big_image_size_threshold', 'dg_big_image_size_threshold', 100, 1);

To Find Your Functions File:

  • You should be using a child theme, if not get that resolved first
  • Then via WP you can edit the theme files
  • Then find the functions.php file
  • Copy, paste at the end then save
  • WP has a nice feature to make sure this doesn’t crash,
  • Ideally you do this via FTP with a text editor with undo steps, CTRL Z saves us all from time-to-time

What You Should be Doing with your images

This is another too little to late scenario from WP, that is not really thought through.

This update is destructive, messing with images as they are uploaded and giving very little notification, the first time I saw this was when all my images got this terrible prefix.

Anyone posting regularly needs a solution doing a few things:

  • Resizing images as they upload, while retaining the original – Premium WP Smush (https://premium.wpmudev.org/) does this for folks on web hosting, many managed WordPress web hosts provide a type of this too, none are imo as good as WPMUdev.
  • Serving images scaled based on device – This is the real magic, most new hosts and the WPMUdev image CDN all do this by default
  • Conversion of PNG to JPG – All PNG files can now be SVG, its very rare a PNG is needed anymore, super high file size for what they are – WP Smush does this but I would enable a process to stop authors here, or modify your own behavior, PNG is dead as a web format
  • Conversion of JPG to WEPB (https://developers.google.com/speed/webp) this coupled with a few other needs mean WP in most cases should be the file store but you dont serve images from your domain anymore, Image CDN, Image CDN, Image CDN, keep saying it until it settles in 🙂 Images are 80-90% of a page’s load, it is so simple now to put a nitro in your WP’s rear checkout WPMudev in general, hosting plugins the lot, all my sites use a few of their excellent plugins

Summary

  1. Disable this today, don’t allow WP resize client images or yours
  2. This is a sub par solution and only addresses a really precursory part of the issue or fast images on your site
  3. In true WP format its now created a new issue, many authors dont save images, this is bad but a fact, the CMS is the store for images
  4. These days you can upload a 5000px image in seconds, and have the AI do this work for you, then serve it back
  5. This process now forces users into image editing software, all my clients are trained to rename images and upload the CMS and plugins do the rest, plus that image is there if we ever need it or if Google change size requirements for AMP etc
  6. This is also most likely a failing of the inner WP editor to handle big images, it should never be used, it is pure garbage, i.e. never resize images using the Edit functionality in WP

Hire a Freelance WordPress Designer, Developer & SEO