How to insert 4K images in your WordPress posts

Last updated on December 21, 2022 Hadrianus Loading... Post a comment

After editing your php.ini file (setting upload_max_filesize = 100M or another big number), you can upload big images but still can not insert them into your posts.

Even if you select Full Size from the image size option on the right sidebar of your Gutenberg editor, it seems not working.

For example, you try to embed a 4K image (3840 x 2160) to your post but it automatically scales to 2560 x 1440 (sorry, I don’t remember exactly the height, but the width is absolutely 2560). This is not an error but a feature of WordPress that intends to help speed up your site. However, sometimes we don’t need this feature, i.e. when we have a wallpaper’s website.


Just add the code below somewhere in your theme functions.php:

add_filter('big_image_size_threshold', '__return_false');

You might need to go to Settings > Media and update Max Width and Max Height of Large size to very big numbers or zero (no limited):

Save your changes, reload your site and try adding a big photo into your post to make sure it works as expected.

Further reading:

I have made every effort to ensure that every piece of code in this article works properly, but I may have made some mistakes or omissions. If so, please send me an email: [email protected] or leave a comment to report errors.

Notify of
Inline Feedbacks
View all comments

Related Articles