Jpeg Image Optimization in CentOS for SEO and PageSpeed Ranking.

So here’s a quick guide on a completely automated way to optimize all your jpegs in CentOS to increase your pagespeed rank and hopefully boost your SEO too. This will also help get rid of any PageSpeed errors like “Optimize Images” by reducing file sizes by up to 40%!

PageSpeed_Optimize_Images_Error

An example of how Google wants you to optimize your jpegs in order to boost your pagespeed rank

1. Install jpegotim

yum install jpegoptim

Yum Install jpegoptim
Yum Install jpegoptim2

2. open a SSH session or terminal and navigate to your folder where your website files are located. Generally under centOS this is /home/YOURWEBSITE

cd /home/YOURWEBSITE

3. Run jpegoptim against all jpegs

Just copy this code and run

find . -type f -name “*.jpg” -exec jpegoptim {} \;

Note: this will strip all image meta tags so make sure you don’t have any personal images in there

Jpegoptim_images_directory

And done, wait for any caches to clear or clear them yourself and rerun Google PageSpeed Insights.

Comments

Leave a Reply

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