When using WordPress as a Content Management System (CMS), have you ever wondered if your uploaded photos were being altered behind your back? When looking at pictures on your blog, do you scratch your head wondering why the screen display looks markedly inferior to what you saw in your photo editing software?

The answer to both questions is: “YES”.

A few days ago, a photographer friend was complaining about how hard it is to find a good image host. He noticed that photography uploaded to his WordPress server looked degraded. He asked whether there was a reliable commercial photo-hosting platform (like Flickr) where his photography could maintain pristine quality while embedding images into his posts.

His plan was to use hotlinks to embed external hosted images into his WordPress articles. Everyone in our circle admired his dedication to detail—how many clients would actually scrutinize image compression to that extent anyway? (Inner voice: some of us happily publish blog posts with quick smartphone snapshots!)

The root cause is quite straightforward: when you upload an image, WordPress “helpfully” performs an action that I find completely unnecessary—lossy image compression, defaulting to a 90% quality level.

Anyone with photography experience knows what a 90% JPEG quality setting implies. Generally, that compression level is right at the boundary of acceptable tolerance for photographic work.

Standard image editing software (like Adobe Photoshop or Corel Photo-Paint) typically defaults to around 80% to 85% compression when exporting finished images.

If you don’t adjust that parameter, your exported image has already undergone lossy compression, meaning original pixel data cannot be recovered.

When you then upload that photo to WordPress and it gets automatically compressed again at 90%, the effective quality drops to roughly 72% of the original master. That is far lower than what most discerning creators find acceptable.

WordPress probably implemented this with good intentions—to optimize bandwidth usage and accelerate page load speeds. But for enthusiasts and professionals, failing to provide an intuitive dashboard toggle for compression settings deserves a stern reprimand.

Fortunately, this problem is easy to fix. Let’s adjust this 90% compression rate to 100% uncompressed uploads!

Preserving 100% Image Quality on WordPress Uploads

Step 1: Log in to your WordPress admin dashboard.

Step 2: From the left sidebar, navigate to “Appearance”, then click “Theme File Editor”. This opens the theme editing screen on the right.

Tip: I recommend pasting custom code at the very top of the file. Press “Enter” to insert a clean blank line first. Never place code inside { ... } blocks or between /* ... */ comment tags, otherwise the snippet will fail or, worse, trigger a white screen of death.

Step 3: On the far right under “Theme Files”, find the "**functions.php**" file (sometimes titled “Theme Functions”).

Step 4: Click "**functions.php**" to load its code into the text editor. This area is directly editable, so proceed carefully. (Standard procedure calls for backing up the file first; if you choose not to, just be extra cautious).

Step 5: Copy and paste the following line of code into a blank space:

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

(Note: In modern PHP 7.4+, you can also write this with an anonymous function: add_filter( 'jpeg_quality', function() { return 100; } );)

Step 6: Click the “Update File” button to save. From this point forward, every photo uploaded to your WordPress media library will be preserved at 100% full original JPEG quality!

Customizing Image Compression to Any Level

If server bandwidth and storage efficiency are your top priorities, you can also adjust the setting in reverse by increasing the compression level (though I personally advise against aggressive compression).

Repeat Steps 1 through 4 above, and replace the snippet in Step 5 with:

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

Here, 75 indicates a 75% quality rating. If you feel adventurous, you could even try 10, though you do so at your own risk!

Important Considerations After Updating

While this configuration ensures all subsequent photo uploads remain at 100% uncompressed quality on your WordPress host, it does not retroactively alter previously uploaded images. In other words, previously uploaded photos will remain at their original 90% compression state.

My personal workaround was installing the “Regenerate Thumbnails” plugin. This tool allows WordPress to recalculate all media library thumbnails, resizing them according to “Settings” > “Media” and reapplying new compression quality parameters.

However, as mentioned earlier, lossy compression permanently discards image data. Recalculating previously compressed 90% images cannot magically reconstruct lost detail to 100%. But if you are migrating to a higher compression ratio for bandwidth savings, regenerating thumbnails will successfully convert all past images to your specified rate.

Further Reading:
  1. Regenerate Thumbnails
  2. Differences in Photo Display Across Facebook, Flickr, and Picasa
✦ Independent Journalism · Reader Support ✦

Support Independent Perspectives & In-Depth Insights

Every thoughtful analysis and candid critique comes from our dedication to truth and quality. We choose not to follow sensational algorithms or clickbait headlines.

Sustaining independent research requires reader support. Make a one-time or monthly contribution, securely processed by Google.

Payments secured by Google · Manage or cancel anytime in your Google Account