How to Enable GZIP Compression in WordPress

Best WordPress Hosting

We know that the load time of a website now affects SERP. As per Google, if your website takes more than 3 seconds, you are losing valuable traffic. There are lots of things that affect load time. I already wrote how to speed up the WordPress website. Enabling Gzip compression is also a way to improve load time. If you are not sure how to enable Gzip compression in WordPress, keep reading. In this article, I will explain everything you need to know about Gzip and way to enable it in WordPress.

Also see: How to leverage browser caching in WordPress

What is GZIP Compression?

GZIP is a file format used for file compression. If it is enabled on the server side, it serves the compressed form of HTML, stylesheets and Javascript files. Gzip compression can reduce files for up to 70%. When a user request for a web page, browser checks if the web server has GZIP enabled by checking content-encoding: gzip” response header. If this header is present, it serves compressed files.

How to enable Gzip compression

Compression is enabled via web server configuration. So, different web servers have different steps to enable the compression. WordPress has nothing to do with the server as it is just a PHP based script. But caching plugins allow you to edit .htaccess rules to enable the GZIP compression.

In Apache server

If you know how to edit .htaccess file using Cpanel or FTP, you should add this code in .htaccess file. Add this code after the existing code. You can find this file on the root of your WordPress installation. Make sure to have a backup of this file before you make changes. If you do anything wrong, it will break your website.

In NGINX

If you are running on NGINX server, add the following code in nginx.conf file.

How to check if Gzip Compression Is Working

There are few websites where you can check if Gzip compression is working on your website. You can use these websites.

Final Words

There are several factors which affect Website’s load time and every single thing should be taken care. Gzip is an important thing and you must enable it on your website. You will surely see the improvements in load time.

Website’s load time affect ranking on Google. So, you should take this seriously.

Do you want to say anything? Any thoughts or additional tips? You can leave a comment.

advertisement

About The Author

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Receive fresh web design resources and SEO tips in your email by our weekly newsletter

You have Successfully Subscribed!