Looking for something?

How to disable image scaling in WordPress (a version 5.3 update)

Last week, WordPress released its 5.3 update and with it, they introduced a range of new features.

Within this update, they added a feature that forces large images to scale down in size so that they are “web-ready”. So if an image is larger than the default threshold (2560px) WordPress will automatically scale it down.

As I’m sure you already know, large images are problematic because they can impact on the loading time of a website, which in turn has a negative impact on SEO and user experience, and they take up a lot of space on the server.

Now, I do understand why WordPress has added this feature in. Many WordPress users upload images to their website directly from their camera or from a stock image website, and these images are often huge! However, there are times where we do want to upload large images to our WordPress websites, despite knowing that they will slow down our websites, and we don’t want WordPress to stop us from doing so.

Anyway, I found out how to easily remove this new image scaling functionality and I thought I’d share my knowledge with you just in case you are having problems uploading images to WordPress.

In this post, I’m going to show you how to stop WordPress scaling large images after the version 5.3 update.


1 | Open up your functions.php file

First things first, you need to open up the functions.php file for your theme. You can either do this using FTP or directly within the WordPress admin area.

To access the functions.php file via the WordPress admin area, hover over Appearance in the left-hand menu of WordPress and click on Theme Editor.

How to access the WordPress theme editor

If you can’t see the Theme Editor option, it may have been disabled either using a plugin (usually a security one), via the theme or via some code in your website files. You may need to contact a developer if you’re not sure how to access this.

Once you have the Theme Editor open, click on Theme Functions (function.php) on the right-hand side of the screen. This will open up the functions.php file.

How to edit the functions.php file

If you are using a pre-made WordPress theme and you aren’t already using a child theme, I highly recommend setting up one and editing the functions.php file of the child theme rather than the main/parent theme.

2 | Paste in this add_filter() function

Now that you have opened up your functions.php, all you need to do is paste in the following code at the bottom of the file:

add_filter( 'big_image_size_threshold', '__return_false' );

If you have a closing PHP tag (?>) then make sure this code goes before this, like so:

How to remove the image scaling functionality added in my WordPress 5.3

Then all you need to do is save your functions.php file (and upload it if you’re using FTP) and you’re done! You’ll now be able to upload larger images without WordPress forcing them to scale down in size.


Looking for more helpful advice?

Sign up to receive my free monthly newsletter!

On the last Friday of each month, I send out my monthly newsletter jam-packed with tips, tricks and resources to help you create and maintain the WordPress website of your dreams. And it’s completely free!

Simply enter your name and email below to sign up…


.

 

You can unsubscribe at any time by clicking the link in the footer of my emails, and I promise never to send you any spam. For more information check out my privacy policy here.



Comments

  1. Jamie says:

    Thanks for this, makes my the site look soooo much better ! – I wondered why the images all looked terrible until i noticed the sizes and that they were renamed ..

    🙁

    This was a great find !

    Thanks again !!

  2. Sander says:

    This problem is also driving me mad. Too bad this solution is not working for me.

    • Holly Pryce says:

      Hmmm, that’s odd that it’s not working? Is it definitely an issue with the images being scaled because they’re too large? The image URL will end in “-scaled” if this is the case?

  3. Tiff says:

    OMG lifesaver!

  4. Phil says:

    I was caught off guard when my images were scaled down after the WP update. Thanks for posting this!

  5. Matthew says:

    I’m a photographer, and on my site, sometimes it just makes sense to allow large images… especially since my audience is other photographers who likely have 4K monitors.

    This fix was very quick and helpful… thanks!

    – Matthew

    • Holly Pryce says:

      Hey Matthew,

      I’m glad this post helped! I kind of understand why WordPress put this measure in place but as you say, people have large, high-resolution monitors and 2000px wide images just aren’t going to be good enough!

  6. Mike says:

    If the solution does not seem to work, it is most likely due to a plugin that uses the same hook at a higher priority (therefore, overriding your hook). A simple mod fixes it, use the Holly’s solution with one small change:

    add_filter( ‘big_image_size_threshold’, ‘__return_false’, PHP_MAX_INT-20 );

    The added factor (PHP_MAX_INT-20) helps to assure that your filter will have the highest priority. Plugins like Imagify elevate their hook to PHP_MAX_INT-30, which is why the solution with no priorty set (default is 10) doesn’t work in some situations.

    For more info: https://developer.wordpress.org/reference/functions/add_filter/

  7. Mike says:

    Whoops! Thats PHP_INT_MAX the corrected line is:

    add_filter( ‘big_image_size_threshold’, ‘__return_false’, PHP_INT_MAX-20 );

    … cannot type!

  8. Mirjam The says:

    Hello,
    my Host sent me your page to solve my problem, which is:
    If i upload my images they get scaled down to more then half size, but I want to sell them and I have to upload them in a big size.
    I tried the steps but they dont work.

    What can I do else ?
    Or can you send me a detailed description how to to it – I pasted it at the bottom of the function.php but it didnt work.

    Thanks in advance
    Mirjam

    • Holly Pryce says:

      Hey Mirjam,

      Could you try the code without the quotes round __return_false? So it would be add_filter( 'big_image_size_threshold', __return_false); instead.

      If not it there might be a plugin or something in your theme stopping this from working.

  9. Rezo says:

    Hello and thank you very much! It works fine from my side.
    Best regards
    Rezo

  10. Joseph says:

    Hi Holly. the code works like magic! thanks fo the clear direction!, at first i can;t find the theme function editor , found out that that WP security block it for security reason. Thank you very much.!

    cheers
    joseph

  11. Thank you so much for this! I didn’t know this had been changed and was going crazy trying to upload a brand board. Took me a while to notice that WP had scaled my image for me.

  12. Thank you… this tip was quick and very useful.

  13. Bill says:

    The issue of scaling is giving me a big headache. I need my images to be very high resolution for invertebrate identification and good old wordpress keeps scaling my images which is very unhelpful.

    I do have a child theme and have tried the options above without having any success, I have also tried a plugin called scale large image threshold also without any success.

    Would you have any idea of what other avenues i can explore to resolve this frightfully annoying wordpress attribute?

    • Holly Pryce says:

      Hey Bill,

      If adding this code to the functions file isn’t working then it might be an issue with your theme scaling your images. A lot of themes uses image resize functions to ensure that the images fit into the design correctly, but unfortunately, it can mean that the images get resized and scaled.

Leave a comment

Comment

* = Required. Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.