Controlling the quality of your uploaded image files in WordPress might be something to consider. By default, WordPress doesn’t upload images with 100% image quality. If you want higher quality images or lower image quality, then consider adding this snippet of code to a plugin file or your currently active WordPress theme’s functions.php file.

This is going to be a short post. Mainly just a quick snippet of code. If you’re a developer or feel savvy enough to dive into hooks, this is a quick and useful snippet of code.

WordPress reduces the image quality of uploaded images by default. Maybe you want maximum image quality of 100%, or maybe you want to reduce the image quality even more than WordPress does by default (Let’s say for faster load times or to save bandwidth).

You can place this code in your currently active WordPress theme’s functions.php file or into a WordPress plugin. Preferably in a plugin file would be best, but theme files should work too.

Please write a comment if you found this code useful, have questions,  or have ideas on improvement.


  1. Hi Michael, I tried to implement your code but I couldn’t get any result, same low quality images even after re-upload them.
    What could be?

    • If the image quality is low to begin with, you cannot improve the quality of the photo with this code. The code mentioned in this article is primarily for those with an interest in PRESERVING the image quality or REDUCING the quality of the image to improve load times and/or save data transfer (A/K/A bandwidth).

Leave a Reply