How To Enable Gzip Compression On Your WordPress Site Without A Plugin

Do you want to speed up your website’s load time without even adding some additional plugins to it? If you haven’t tried enabling gzip compression on your site, you should start implementing this right now. Once you properly enable gzip compression on your wordpress site, you will see a that your site will be much faster to load up.

So, in this article, you will learn how to enable gzip compresion on your wordpress site. It is not always necessary that you have to add another wordpress plugin just to enable gzip compression on your site because this can be done right directly inside your site’s cpanel.

How Does Gzip Compression Work For Your Site?

But before we proceed, let me share with you what Gzip is all about so that you’ll have a full grasp of what it can do to your site.

In simple words, Gzip simply means a method of compressing your webste’s files before they are sent over to the browser of your visitors. So, let me give you an example, when the visitor visits your wordpress site or requesting to view its hompage that has an actual size of 800kb, their web browser will only receive 400kb or less.

So, you can see the big difference. This is what will happen once you enable gzip compression on your wordpress site.

Enabling gzip means lesser load on the side of your server, less resources are required to load up the necessary files and the transmission of file is quicker compared to the one that has no gzip feature enabled. Additionally, you site will load much faster on the web browser of your visitor.

This Is How To Enable Gzip Compression For Your WordPress Site to Load Faster

Since gzip compression is not on by default, you need to do something to have it activated on your wordpress site for you to take advantage of it’s poewrful compression system.

Here is what you need to do:

To enable gzip compression, you need to use mod_gzip to to have it enabled on your wordpress. This can be done by adding the following code below to your .htaccess file which can be found in the root directory of your wordpress site. (Just copy and paste the code below)

# BEGIN GZIP COMPRESSION 
<IfModule mod_gzip.c> 
mod_gzip_on Yes 
mod_gzip_dechunk Yes 
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$ 
mod_gzip_item_include handler ^cgi-script$ 
mod_gzip_item_include mime ^text/.* 
mod_gzip_item_include mime ^application/x-javascript.* 
mod_gzip_item_exclude mime ^image/.* 
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* 
</IfModule> 
# END GZIP COMPRESSION 

Another way of enabling gzip compression on your wordpress site is by using mod_deflate. You can just copy and paste the code below to the .htaccess file of your site. Again, you can locate it in the root directory of your site.

# BEGIN DEFLATE COMPRESSION 
<IfModule mod_deflate.c> 
# Compress HTML, CSS, JavaScript, Text, XML and fonts  
AddOutputFilterByType DEFLATE application/javascript  
AddOutputFilterByType DEFLATE application/rss+xml  
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject  
AddOutputFilterByType DEFLATE application/x-font  
AddOutputFilterByType DEFLATE application/x-font-opentype 
AddOutputFilterByType DEFLATE application/x-font-otf  
AddOutputFilterByType DEFLATE application/x-font-truetype  
AddOutputFilterByType DEFLATE application/x-font-ttf  
AddOutputFilterByType DEFLATE application/x-javascript  
AddOutputFilterByType DEFLATE application/xhtml+xml  
AddOutputFilterByType DEFLATE application/xml  
AddOutputFilterByType DEFLATE font/opentype  
AddOutputFilterByType DEFLATE font/otf  
AddOutputFilterByType DEFLATE font/ttf  
AddOutputFilterByType DEFLATE image/svg+xml  
AddOutputFilterByType DEFLATE image/x-icon  
AddOutputFilterByType DEFLATE text/css  
AddOutputFilterByType DEFLATE text/html  
AddOutputFilterByType DEFLATE text/javascript  
AddOutputFilterByType DEFLATE text/plain  
AddOutputFilterByType DEFLATE text/xml 
</IfModule> 
# END DEFLATE COMPRESSION 

Check To See If Gzip Compression is Activated

So, after you’ve added the code above to enable gzip compression on your site, what you need to do next is to check if it’s activated.

Gzip Compression Test Tools

There are so many available tools online used for testing site’s gzip compression. So here below are some of those sites that can check if gzip is activated on your site. So, start using them.

I also tested the gzip compression of my site and here below is the result I got:

How To Enable Gzip Compression In Cpanel

As you can see in the result above, 76.51 percent of my site is gzip enabled. That’a already ok for me. At least, more than half of my sites are compressed gzip.

So, that’s how easy it is to enable gzip compression on your wordpress site. And that concludes this article about “How To Enable Gzip Compression On Your WordPress Site Without A WordPress Plugin”. If you found this article helpful, please consider sharing this with others.

Leave a Reply

fifteen + 8 =

This site uses Akismet to reduce spam. Learn how your comment data is processed.

WPreformer uses affiliate links. This means if you click and make a purchase through those links on this site, WPreformer will receive a small commision. However, purchasing products or services via affiliate links doesn't cost any extra. Click Here For Full Disclosure.
Don`t copy text!