Since WordPress 5.3, WordPress by default prevents publishers from sharing images wider or taller than 2560px. This is a nuisance if you want to share full sized-images.
Why does WordPress prevent publishers from sharing full-size images by default
The reason the limitation is there is that there are many mobile phones which take photos up to 48MP. A single photo measures 8000×6000 pixels and clocks in at 15 MP as a jpeg. Serving up images in this format will make mobile phone visitors very unhappy and will earn publishers a big penalty in Google Page Speed scores. So WordPress decided to play big brother here and prevent publishers from penalising themselves with visitors and Google.
What’s important to note is that if any publishers believe that by serving and linking only 2560px images, they are protected from copyright thieves, they are not protected.
If you upload a 5000px file, after WordPress 5.3 it will show up as 2560px wide by default.
Here’s what the URL will look like:
https://uncoy.com/images/2021/11/20211107-124523-Aurelien-back-from-tasting-dirt-scaled.jpg
That’s great, except it’s very easy for someone who wants the original to simply remove -scaled
from the end.
https://uncoy.com/images/2021/11/20211107-124523-Aurelien-back-from-tasting-dirt.jpg
This will get you the full size image.
It’s important to only upload the largest file which you’d like to share with the world to your WordPress website.
That said, there’s a good chance that some publishers do want to share at least 4K images with their audience. There’s lots of visitors out there with UHD monitors (also known as 4K) at 3840 x 2160px. For instance with my football pictures, I like to share 4K images for those browing them at home. Many of the images are large scale shots conceived for viewing in detail.
For instance, this image is called Two Trainers. The subject is not the players (who are out of focus) but about both coaches and both team benches watching the game in front of them at the same time:
The subject extends across the width of the full image. It’s better to let people see the full 7251 × 2910 pixels image. This is not the best example but just one which came up in the first football post on Uncoy.com. There are times where it is much better to give people the larger immage.
How to disable WordPress 2560px image size limit via theme or via functions.php
In this case, there are two choices to disable the default nanny function which limits image size to 2560px. Unfortunately there’s no GUI for this, so one has the choice of modifying one’s theme with this code:
add_filter( 'big_image_size_threshold', '__return_false' );
I don’t like theme based modifications as if one changes the theme, all kinds of unexpected trouble results. Here’s the code you should add to functions.php
:
function td_big_image_size_threshold( $threshold, $imagesize, $file, $attachment_id ) {
return 4096;
}
add_filter( 'big_image_size_threshold', 'td_big_image_size_threshold', 10, 4 );
We will also be adding have added a preference to the images options screen (~/wp-admin/options-media.php) via our BusinessPress WordPress missing features plugin.
Here’s what the new screen looks like:
There’s a very decent plugin by Jonathan Desrosiers called Disable Big Image Threshold but we try to avoid adding a whole plugin to manage a single very small issue like this.
Steps to take before uploading very large images to WordPress
Don’t leave compression up to WordPress or even a third-party add-on service like Ewww, ShortPixel or WP Compress as it slows down publishing and often won’t correct your original. My final step before publishing a set of large images is to run them through the free ImageOptimize before uploading.
Here’s my settings:
I choose 90% as that creates much smaller files with almost no visual loss. It’s important to leave quality very high as WordPress will be resizing from these sub-masters.
ImageOptimize routinely takes my 20 MB masters and turns them into 2 MB highly optimized but full sized jpegs.
Alec Kinnear
Alec has been helping businesses succeed online since 2000. Alec is an SEM expert with a background in advertising, as a former Head of Television for Grey Moscow and Senior Television Producer for Bates, Saatchi and Saatchi Russia.
Leave a Reply