Are your WordPress website images low quality?

By 23rd February 2017 No Comments

Did you know that WordPress compresses all the images that you upload even if you choose ‘Full-Size’ from the upload options? It’s trying to help you out by reducing unnecessarily large files clogging up your server and increasing your website load times. By default WordPress will compress your images to 60% of their original quality. Normally that’s no big issue but if your business is in the visual arts sector such as photography, art, design etc. or any other business which needs to portray the very highest quality then it’s not helping you at all. Not to worry, there’s a solution. Read on…

Firstly, it helps if you’re competent using WordPress. If not, there are plenty of people out there who know WordPress including myself and it’s not a big job. But first a disclaimer: Do not carry out any modifications to your website unless you are confident that you know what you are doing. I accept no responsibility for breakages or losses whatsoever and might not be able to help if the sky falls on you. What works today might not work with all themes or future versions of WordPress. Make sure you Backup before stepping out of your comfort zone.

Two Steps to improving the quality of your WordPress website images

1. Find your themes functions.php’ file (that’s the theme functions not any other). If you’re using a third-party theme it’s best to create a child copy of your functions.php file otherwise when you update your theme your changes will be lost. If you don’t know how to do that just google it.

2. Add the following code to the end of your themes ‘functions.php’ file and save it.

add_filter( 'jpeg_quality', create_function( '', 'return 90;' ) );

Note the ’90’ above. That’s the new compression level of your files – 90% quality. Change it to ‘100’ you like but remember that it will increase the size of all the files you upload.


Please remember that this will only change new images that you upload, not older ones. You can improve the quality of older images by installing and running a plugin called Regenerate Thumbnails from the WordPress plugins repository.