Knowledge Base
MilesWeb / WordPress FAQ

Learn to Enable GZIP Compression in WordPress

Approx. read time : 3 min

The very first solution to achieve faster load times of your WordPress CMS is to reduce your page size. Enabling GZIP compression is the simplest method to reduce the size of your website, and improve the time to first render of your web pages. When you enable GZIP compression on your server it helps to significantly reduce the amount of time to download the requested resource. In this tutorial, you will learn to enable GZIP compression on WordPress.
Let’s start.

Steps to Check If GZIP Compression is Enabled

In order to check if the GZIP compression is already enabled on your site, you have to search the Internet and check for ‘GZIP compression online check’. This is one of the easiest ways to check if the GZIP is enabled on your server.

Steps To Enable Gzip Compression For WordPress Websites

You can use several different methods to enable GZIP compression on your WordPress website.

Enable GZIP on Apache

For enabling GZIP compression on Apache web server, you will need to edit your .htaccess file. Add the below lines of code to your .htaccess file. You can find the .htaccess file in the root or the WordPress site.

Enable GZIP with WordPress Plugin

You can also use a caching plugin that support GZIP compression. For instance, the WP Rocket will add GZIP compression rules to your .htaccess file and it will automatically use mod_deflate. For enabling this via W3 Total Cache, you will need to go under its performing section and then enable it.

Enable GZIP on NGINX

To enable GZIP on NGINX, you simple have to add the below lines to your nginx.conf configuration file:

Surely, you don’t have to enable GZIP compression in WordPress, if you use our managed WordPress hosting service, in which we already include GZIP compression. If there is any issue with this, you can contact our support team via live chat or email.

Pallavi Godse
Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.