Do you want to make your site faster, increase SEO ranking, and attract more traffic? You can do it all by compressing your web files using the GZIP file format. Your website will take less space, and site speed might be improved.
Sounds interesting? Read on to find out how to enable GZIP compression on your site.
What Exactly is GZIP Compression?
What’s more, Google includes page loading time as one of the factors in its ranking algorithm. The faster your site loads – the higher you’ll rank.
Considering the benefits of GZIP compression, it’s important to check whether your site has enabled it or not. You can use the Check GZIP Compression tool to do so.
If GZIP is already activated, the tool will show you the page size before and after the optimization. If it’s not, an error message will appear.
How to Enable GZIP Compression?
Using a WordPress Plugin
The easiest way to enable GZIP compression in your WordPress site is to install a plugin. It will be a lot easier and safer than modifying the .htaccess file.
There are a lot of plugin choices available, but we have singled out these three plugins based on their features and ease of use:
- WP-Optimize — an all-in-one solution to boost your website performance. The plugin will enable GZIP compression and web caching. In addition to that, it will clean unnecessary files on your website. This tool can even optimize images to free up more space!
- Hummingbird — you have more freedom to choose what aspects you want to optimize. GZIP compression, minification, and lazy load offscreen images are some of its main features.
- WP Fastest Cache — WP Fastest Cache combines its caching prowess with GZIP compression to make your page fast and lightweight. This tool can also automatically disable emojis and optimize every single post.
Since these plugins can do so much more than enabling GZIP compression, I suggest that you try all of them to see which one fits you best. After all, they are free and frequently updated, what’s not to love?
Adding Code to the .htaccess File
This method is quite technical, so it’s more suitable for advanced users. However, anyone can do it as long as they are careful.
Before we continue, remember that you should always back up your .htaccess file first in case something goes wrong.
- You will need to download an FTP client, like Filezilla, to locate the .htaccess file. It is usually placed in the public_html directory of your website.
- Download the file and save a copy on your computer as a backup. Then, paste the following code before # END WordPress line of .htaccess.
- Upload the edited file to the same location. If FileZilla asks permission to overwrite it, click OK.
Now, if you use the Check GZIP Compression tool again, the results should look like this:
GZIP compression reduces the size of your pages and speeds up your site. As a result, visitors will have a great user experience and your site can rank well in SERP.
You can easily enable GZIP compression on your site by using two methods: either installing a WordPress plugin or editing the .htaccess file. Here’s a summary on how to do that:
- Via a plugin. Choose one of the plugins that we recommend and install it on your WordPress site. Go to the plugin’s settings page, and then run the automatic optimization.
- Via .htaccess file. Use FileZilla to locate the .htaccess file, and then add the code that we have provided. Upload the file to your website directory and overwrite the old one.
Pretty easy, right? Let us know in the comments if you have any questions!