Main Menu

Increase JPEG Quality in WordPress

When you upload an image to WordPress it’s processed and compressed to 90% of its original JPEG quality. This is a default setting that’s in place to automatically optimize every image, which in turn can hopefully speed up your site’s loading time.

It’s a nice enough little feature, but the fact that it happens behind the scenes without anyone really knowing it’s going on can cause some users a lot of grief. Especially photographers who see a drop in JPEG quality every time they upload an image.

There’s no option to change this within the WordPress admin and not having the power to control the JPEG quality of your images can be frustrating.

Stop Compressing My Images Already!

As with most features in WordPress, there’s a filter or action in place that we can hook into which will allow us to modify and customize certain functions. For this mod, the filter we need to hook into is called jpeg_quality.

Needs More Compression

If you’re someone who believes in the full extent of optimizing your images, then compressing them even more might be the way to go. It’s an easy enough change since all you need to do is decrease the JPEG quality to a setting below the default of 90.

Sir, 100 is for no compression and 75 is for 25% compression. I’m right ? This compression is lossless or lossy ? I’m eager to implement this method soon. Thank for useful info 🙂

Paul

October 19, 2015 at 8:37 am

@Samk No the scale is not a percentage of how much the file will be compressed. The final file size for a giving setting will very much depend on the image and how efficiently it can be compressed. The compression is standard jpeg compression and therefore lossy.

Hi thanks for this awesome article. This is awesome,
May I ask you one thing can we increase size of jpeg image (E.g. A passport size photo is – 10 KB so can we increase its kb like 10 to 20 ?)
Sorry if i asked this question in wrong section, but when I was filling a job form of my friend I got this error, there they need photo of 15-50 KB and my friend’s jpeg pic was only 12 KB.

Thanks.

Pabitra

February 9, 2016 at 7:23 am

great article. this will help me a lots in wordpress image compression which will improve page loading time.