How to resize and compress images on WordPress?

WordPress
How to resize and compress images on WordPress?

One of the main bottlenecks of slow sites has a lot to do with image optimization.

If your site feels bloated and slow then this post is for you.

How to upload optimized images on your WordPress site?

Large images slow down your site which creates a less than optimal user experience.

Optimizing images is the process of decreasing their file size, using either a plugin or script, which in turn speeds up the load time of the page.

Resizing and then compressing your images can save 50-75% of file size on each image. This adds up when you have many images on the site and helps keep your site’s database optimized!

Their are many image compression tools on the web but my favorite are CompressJPEG or CompressPNG. I also would check out Bulk Resize Photos. They make it easy to bulk compress up to 100 images at a time.

  1. First, open the image you want to upload to your site. Check the image dimensions in Preview, Photo Viewer, or your app of choice. If the image is already the correct size, proceed to Step 3.
  2. Next, resize the image to the correct dimensions. If you do not know the exact size I make sure the image is no larger than 2500 pixels wide.
  3. Then, go to CompressJPEG and upload your image. The image will start compressing.
  4. Finally, save your image and upload to your site.
  5. Bonus: compare the original image to the compressed image and make sure quality was not impacted.

Pro tip: If the image was not compressed at all, hover over the image, and click “Settings”. Then adjust the % quality and click Apply. I usually use a threshold of 75% to 90% quality for JPEGs when using CompressJPEG.

See this video if you are more of a visual learner!

Optimize images that have already been uploaded

Now you know how to properly upload an image to your WordPress site!

But, what about images that have already been uploaded?

How can I optimize those?

There are a few different ways to do this.

Whatever method you choose just make sure to take a backup first.

Or, test on only a few images to make sure you have the hang of things!

A) Plugin method (any size site)

Use the ShortPixel plugin to bulk optimize past images for you automatically.

ShortPixel has a free plan for up to 100 images per month. If you have a larger site, I would recommend to pay their one-time fee to bulk optimize 10,000 images for $9.99 or pay their monthly fee for $4.99/month for up to 5,000 images. You can then cancel if you do not want to use them again. Another benefit of ShortPixel is that they also automatically optimize images for you when uploading new images. I also would check out Imagify as they are another awesome bulk image optimization plugin.

B) Manual method (small sites)

If you have a smaller site (less than 10 pages), the easiest way is to do this the old-fashioned way. This means you will not be using a plugin!

  • First, go to your WordPress Media Library and start downloading each image 1 by 1.
  • Next, resize and compress your images with CompressJPEG or CompressPNG.
  • Then, re-upload your images to each specific page on your site.
  • Finally, double check your site to make sure there are no glaring errors.
  • Bonus: go back and delete the old images in your WordPress media library.

I realize this method is more time consuming than using a plugin. However, this should not take longer than 1 hour if you have less than 10 pages on your site. You also will be learning and understanding what images are the largest and causing the most optimization problems!

C) Manual method (sites with 10+ pages)

If you have a larger site I would recommend downloading a backup of your site as a .zip file. You can also connect to your site via SSH or SFTP and download your uploads folder (i.e. the file path is /wp-content/uploads/). I would recommend starting with optimizing 1 specific year and month (i.e. the file path is /wp-content/uploads/2016/07). Follow these steps:

  • First, upload your images to CompressJPEG, CompressPNG, or another online image optimization service.
  • Next, compress your images and save. The name of the optimized images will have “-min” appended to the end of the name. Rename your images to remove the appended “-min” so it matches the original image name.
  • Then, connect to your site via SSH or SFTP and re-upload your images in your uploads folder to overwrite the old images.
  • Finally, double check your site to make sure there are no glaring errors.

Are you more of a visual learner? Here is short video of how to do this:

Leave a reply

Comment policy: We love comments and appreciate the time that readers spend to share ideas and give feedback. However, all comments are manually moderated and those deemed to be spam or solely promotional will be deleted. Your email address will not be published. Required fields are marked*