How to Enable Gzip Compression in WordPress


Gzip Compression in WordPress:

Easily enable Gzip compression in WordPress via .htaccess file/ W3 total cache plugin, based on Apache and Nginx servers. Gzip compression is an awesome technique to speed up a WordPress site. Page speed is one of the ranking factors in Google search engine result. Gzip loads your web pages faster by reducing the HTML files, JavaScripts, CSS stylesheets and XML files size up to 80 per cent. we are listing the top most methods to enable Gzip compression in a WordPress site.

Benefits of Gzip compression:

  1. Google search engine likes to crawl and index web pages of smaller sizes.

2. The file size will decrease up to 80% and moreover your server bandwidth saving.

3. Your web page loads faster obviously Google and user, both are glad.

Straight forward comes to sharpen, to enable Gzip compression in your WordPress website, take advantage of using any one of the methods from the following list.

Enable Gzip Compression in WordPress via .htaccess :

This is the popular method to activate compression in your WordPress blog. To edit the .htaccess file, you need to log on to C panel or use existing Yoast WordPress SEO plugin. Add the following code to your .htaccess file, then Apache/Nginx server will automatically enable Gzip compression in WordPress.

Gzip Compression on Apache Server

mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*

Gzip Compression on Nginx

gzip on;
gzip_comp_level 2;
gzip_http_version 1.0;
gzip_proxied any;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_disable "MSIE [1-6].(?!.*SV1)";
gzip_vary on;

Enable Gzip Compression with W3 Total Cache Plugin:

W3 total cache is the most trusted and breathtaking plugin to speed up your WordPress website, it will let you enable gzip in WordPress.Many prefer using this plugin over WP super cache and Quick cache.

Go to Performance > Browser Cache and check the option of enabling HTTP (gzip) compression.

Enable Gzip in WordPress using  a plugin :

We don’t recommend to use WordPress plugins for small functions, unless if you don’t have any alternatives. Install WP HTTP Compression plugin and activate, it will automatically enable gzip compression in your WordPress website.

After enabling gzip compression in your WordPress blog, crack out the compression status and confirmation using check GZIP compression online tool.

Leave A Reply

Your email address will not be published.