Enabling Gzip compression in WordPress is one of the simplest adjustments you can make to speed up website load time, and even increase your Google Page Speed score.
What is Gzip Compression?
Gzip compression allows you to save bandwidth resources by compressing website text, script, and images on the web server. After compression, the resources are sent directly to the client browser to be uncompressed. Gzip compression is widely adopted and used on many modern websites.
How to Enable Gzip Compression
Gzip can be enabled manually through editing the websites .htaccess file, or by using a WordPress plugin.
Manually Editing .htaccess
Add the below code to your .htaccess file (be sure not to remove any existing WordPress code):
#Gzip Compression# <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/vnd.ms-fontobject AddOutputFilterByType DEFLATE application/x-font AddOutputFilterByType DEFLATE application/x-font-opentype AddOutputFilterByType DEFLATE application/x-font-otf AddOutputFilterByType DEFLATE application/x-font-truetype AddOutputFilterByType DEFLATE application/x-font-ttf AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE font/opentype AddOutputFilterByType DEFLATE font/otf AddOutputFilterByType DEFLATE font/ttf AddOutputFilterByType DEFLATE image/svg+xml AddOutputFilterByType DEFLATE image/x-icon AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/javascript AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/xml </IfModule> #End Gzip Compression#
Enabling Gzip Through a Caching Plugin
You can easily enable Gzip compression through many of the popular caching plugins. Below is an example showing the Advanced ‘compress pages’ setting in WP Super Cache which will enabled Gzip compression site-wide.
Make Sure It’s Working
Once you have enabled Gzip through your preferred method, be sure to check that it is functioning properly. One of the easiest is to utilize the Google Page Speed Insights tool to ensure that compression is enabled for your website content.
You must log in to post a comment.