Tel: +44 1737 516331

How to Stop WordPress Compressing JPG Images

Last updated on by

Disclaimer: This post may contain affiliate links. If you purchase something through one of those links you won’t pay a penny more, but we’ll get a small commission.

Problems with pixelated photos?

Do you find that WordPress image optimisation plugins compress your JPG images too much, resulting in pixelated, poor-quality photos?

If this is happening to you, it’s probably because your images are being compressed twice!

Pixelated image of Homer Simpson
Pixelated image of Homer Simpson

What many people don’t realise is that WordPress automatically compresses uploaded JPG images by up to 90%. If these images are further compressed with an image optimisation plugin like ShortPixel or WP Smush, the drop in image quality is often noticeable.

You could just disable your image compression plugin, but a dedicated plugin usually offers more control and delivers much better results than WordPress’ native compression function, so it’s not recommended.

There are two ways to turn off WordPress’ built-in image compression feature: by editing the functions.php file or by using a plugin.

In this article I’ll show you how to stop WordPress compressing JPG images using the two methods mentioned above.

Stop!

Before proceeding any further, do yourself a favour and make a backup of your site. It’s much better to have pixelated images than a broken website.

Disable WordPress’ image compression feature

Functions file

1. Open your FTP client (I use FileZilla) and enter your FTP host, username, password and port number.

Edit the functions file using FTP - step 1
FileZilla login form

2. Once you’ve entered your FTP account details, click “Quick connect” to connect to your website.

Edit the functions file using FTP - step 2
FileZilla quick connect button

3. Next, use your FTP client to navigate to the folder where your theme’s files are located. This is usually “public_html/wp-content/themes/[your-theme]/”.

Edit the functions file using FTP - step 3
WordPress theme folder

4. Then right-click your theme’s functions.php file and click “Download” to download it to your computer.

Edit the functions file using FTP - step 4
Download the functions file

5. Once the file has downloaded, open it with a text editor (I use the excellent Sublime Text) and insert the code snippet below. Don’t forget to save the file to your computer once you’ve added the snippet.

// Disable WordPress image compression
add_filter( 'jpeg_quality', function( $arg ) {
    return 100;
});

6. Finally, open your FTP client again and browse to your theme folder. Find the modified functions file on your computer, right-click it and click “Upload” to upload it to your website, overwriting the existing functions.php file.

Edit the functions file using FTP - step 6
Upload the functions file

Plugin

The SMNTCS Deactivate Image Compression plugin is the quickest and easiest way to disable the built-in image compression feature in WordPress.

Installing a plugin in order to accomplish such a simple task is a bit overkill, but for people who don’t feel comfortable editing files directly it’s the preferred option.

The instructions for installing SMNTCS Deactivate Image Compression are the same as for any plugin in the official WordPress repository:

1. Log into your WordPress dashboard and go to Plugins > Add New.

Add New Plugins screen
‘Add New Plugins’ page

2. Then in the search box, enter “SMNTCS”.

Install SMNTCSs Deactivate Image Compression - step 1
Plugin search page

3. Once you’ve found the plugin, click “Install Now”. The plugin will then be downloaded to your WordPress plugins folder.

Install SMNTCS Deactivate Image Compression - step 2
Install SMNTCS Deactive Image Compression

4. Finally, click the “Activate” button to enable the plugin and disable WordPress’ image compression feature.

Install SMNTCS Deactivate Image Compression - step 3
Activate SMNTCS Deactivate Image Compression

Small (and beautiful) images

That’s all there is to it! From now on, any JPG images you upload to your website won’t be automatically compressed by WordPress.

This will enable you to compress your images using your preferred plugin without them looking like they were taken on a mobile phone from 2005.

Small images that load quickly and still look beautiful – and all for just a few minutes’ work!

If you’ve got any other image optimisation tips and tricks you want to share, please let us know in the comments below.

Download free stock photos

Raise your hand if you enjoy spending hours and hours trawling free stock photo sites for images. No, we didn’t think so.

Well now you don’t have to…because we’ve done it for you!

The Big Box of Stock Photos is a growing collection of premium quality stock photos that you can download for free.

The images are organised by category, and every image has a search engine friendly filename so they’re ready to drop into your project as-is.

Best of all, these images can be used for just about any purpose. Use them in your blog posts, on social networks, in your marketing materials and even on client websites.

Procrastination is the thief of opportunity, as they say. So download The Big Box of Stock Photos today!

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on reddit
Reddit

You may also like:

1 Response

  1. Outstanding post Rob. Well done and thanks for sharing. Gave me something to think about. Because I do have an image compression plugin. And never thought much of WordPress image compression. Thanks for the advice…

Leave a Reply

Your email address will not be published. Required fields are marked *