WordPress compresses all uploaded images by default. Compressing images is a technique that, in addition to saving storage space, improves the loading speed of your site. WordPress, according to the documentation, compresses JPEG images to 90% quality. Nowadays, every website owner must consider mobile users, especially because the majority of people have limited data plans, and large uncompressed images will slow down loading times, causing users to abandon the site.This articles describes how to configure image compression in WordPress.
To configure image compression in WordPress, follow these steps:
On the theme editor, select the currently used theme:
The files of the theme will be listed at the right. Click on the functions.php file:
At the end of the functions.php file, insert the following filter to increase the compression quality from 100 to70:
add_filter('compression_quality', function($arg){return 70;});
Click on the Update File to save changes to the functions.php file:
For more information about image compressing and optimization, please visit: https://www.a2hosting.com/kb/installable-applications/optimization-and-configuration/optimizing-images
Subscribe to receive weekly cutting edge tips, strategies, and news you need to grow your web business.
No charge. Unsubscribe anytime.
Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.
We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.