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.
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.
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:
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.
Hot off the WordPress!
Join my FREE email community today to receive helpful tips and advice on building and maintaining your website directly in your inbox every other Friday. Just pop in your name and email address.