How to Enable Gzip Compression in WordPress

Used by more than half of all websites, Gzip Compression remains popular today.

According to W3Techs.com, 55.3% of all websites, including major sites like Microsoft.com, Github.com, and Apple.com, use gzip compression technology.

As the name suggests, Gzip is a compression technology. This technology compresses static files on the server side and sends them to browsers. Browsers will then automatically decompress and display these compressed files. This process makes the web page open faster.

Enabling it is extremely easy if you know which web server you have.

1. How Enable Gzip Compression in Apache

In order to enable gzip compression on Apache servers, the mod_deflate module must be installed. Almost all hosting companies install the mod_deflate module on their servers, so you don’t have to worry.

You need to add the following code into the .htaccess to enable gzip in Apache servers.

Note: If gzip is not active despite following the instructions above, we recommend contacting your hosting company.

2. How Enable Gzip Compression in Nginx

On servers using Nginx, gzip compression cannot be activated automatically, so you have to enable gzip compression manually.

You need to add the following code into the /etc/nginx/nginx.conf to enable gzip in Nginx servers. Do not add anywhere. You should add it inside the http {} section.

After adding the gzip compression lines, save and close the config file and restart NGINX with the command.

3. How Enable Gzip Compression By WordPress Plugin

The easiest way to activate gzip compression is to use a wordpress plugin and the best plugin for this is the WP Fastest Cache plugin.

WP Fastest Cache is the best WordPress cache plugin because It has many speed optimization features, including gzip compression. If you are using Apache web server, you can activate gzip compression with just one click, so you don’t have to deal with modifying the htaccess file.

WP Fastest Cache Settings

Can Gzip Compression Really Speed Up Web Site?

Let me point out right away that; Speeding up a website without using gzip compression is quite difficult. Gzip compression can reduce the size of a website by 50% on average. We did a little comparison to show how effective gzip compression is.

As seen in the example below, Gzip compression reduced the size of our website by about 53%.

Without Gzip Compression

Without Gzip Compression

With Gzip Compression

With Gzip Compression