How to enable GZIP compression to speed up your site

Do you want to make your site faster, increase SEO positioning and attract more traffic? You can do it all by compressing your web files with the GZIP archive format. Your website will take up less space and the speed of the site may improve.

Do you find it interesting? Read on to learn how to enable GZIP compression on your site.

What exactly is GZIP compression?

GZIP compression is a popular method used to reduce the size of web files, including HTML, CSS, PHP, and JavaScript. This will improve the speed of your site, as visitors will download compressed data instead of full-size files.

In addition, Google takes into account page load time as a factor in its ranking algorithm. The better your position will be.

Considering the benefits of GZIP compression, it is important to check whether your site has it enabled or not. To do this, you can use the tool.

If GZIP is already enabled, the tool will show you the size of the page before and after optimization. If it is not, an error message will appear.

How to activate GZIP compression?

There are two methods to enable GZIP compression: by modifying the archive .htaccess or using a plugin, such as .

Use a WordPress plugin

The easiest way to enable GZIP compression on your WordPress site is by installing a plugin. It will be much easier and safer than modifying the file .htaccess.

There are many plugin options available, but we have selected these three plugins based on their features and ease of use:

See also  How to Create an Online Store Easily

Since these plugins can do much more than enable GZIP compression, I suggest you try them all to see which one suits you best. After all, they are free and frequently updated, what more could you ask for?

Add code to the .htaccess file

This method is quite technical, so it is more suitable for advanced users. However, anyone can do it as long as they do it carefully.

Before continuing, remember that you should always make a backup of your file .htaccess first in case something goes wrong.

  1. You will need to download an FTP client, such as , to locate the file .htaccess. It is usually located in the directory public_html of your website.
  2. Download the file and save a copy to your computer as a backup. Then paste the following code before the line # END WordPress from the .htaccess.

AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/x-javascript

  1. Upload the edited file to the same location. If FileZilla asks for permission to overwrite it, click OK.

Now, if you run the GZIP compression checker again, the results should look like this:

conclusion

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 the SERPs.

You can easily enable GZIP compression on your site using two methods: by installing a WordPress plugin or by editing the file. .htaccess. Here is a summary of how to do it:

  • with a plugin. Choose one of our recommended plugins and install it on your WordPress site. Go to the plugin settings page and run the automatic optimization.
  • Using the .htaccess file. Use FileZilla to locate the file .htaccess and then add the code that we have provided. Upload the file to your website directory and overwrite the old one.
See also  How to set up Cloudflare CDN for a WordPress blog?

Pretty easy, right? If you have any questions, let us know in the comments.

Gustavo is passionate about creating websites. He focuses on the application of SEO strategies at for Spain and Latin America, as well as the creation of high-level content. When he is not applying new WordPress tricks you can find him playing the guitar, traveling or taking an online course.

Loading Facebook Comments ...
Loading Disqus Comments ...