3 Ways to enable Gzip Compression for WordPress Website


Today in this post we will learn about using or enabling Gzip Compression in WordPress with top 3 easiest ways. Fast loading speed is a main factor to boost your Ranking on any Search Engine such as Google, YAHOO!, Baidu etc. Now Google is promoting sites having fast loading websites with light weight coding according to the age of 2016, because Google loves its users and you should also care about your visitors because they act a major role in your online business journey. If your blog or website loads too slowly then it is possible that your users will not visit your website again due to poor user experience on your website. As you know mostly WordPress bloggers are suffered by this problem, but you can improve your loading speed on every browser by compressing Gzip to load your blog faster than before. So here are the fully valuable tips improve your website’s performance with 3 easiest methods you should follow…

Note: We want to improve our website's performance and usability so that you could really get a great benefit from our website. Just more one thing is that We publish all content only for testing purpose not for commercial use, so if you have money then we strongly recommend you to buy the require plugin/theme etc from original developer's website. Use any theme OR plugin on your own risk!

How to Enable Gzip Compression in WordPress

How to enable Gzip Compression for WordPress Website?

In this valuable article we will study three best methods to Enable Gzip Compression in WordPress using .htaccess file, Plugins and the last through PHP file named “index.php”. All the procedures are easy to follow as those are mentioned below with proper screenshots. So that you can easily follow them and could do as smoothly…

1. Enable Gzip Compression via .htaccess file in WordPress

This is the most usable way to enable compression in WordPress using htaccess. Because this is an immediately workable method after applying the below code into your .htaccess file using filezilla or filemanager in your cPanel account. But we suggest you to use it with precautions as it is the main file of WordPress, so if you edit it wrongly then it may creates some problem in your website/blog. So do your job carefully! Okay now let start…

Important Note: Please make a backup of your .htaccess file before adding any code to it. For backup this file you can simply copy that file to your local drive.

backup htaccess file

i) Login to your account via FileZilla and for this you need to have “Host Address” , “Username” and “Password

ii) Open “public_html” folder

using filezilla

iii) Here you cannot see .htaccess file because this file is hidden by default, you can show it by filezilla options, Server >> Force showing hidden files and then click on that option to show .htaccess file

force showing hidden files

iv) Now edit that file and add the below given code at bottom of the file

edit htaccess file

<IfModule mod_deflate.c>
# Insert filters
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
AddOutputFilterByType DEFLATE application/x-httpd-php
AddOutputFilterByType DEFLATE application/x-httpd-fastphp
AddOutputFilterByType DEFLATE image/svg+xml

# Drop problematic browsers
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary

v) Now hit the “Save” button and you are done.

click on yes button

2. Enable Gzip using Plugins

If the above method is more complex for you then you can use this way in order to an alternative method. For this you just have to install one of the below free plugins which are available at WordPress.or repository… You just have to download it and then install it on your website then activate its settings…

These are Best WordPress Compression plugin!

  1. GZip Ninja Speed Compression
  2. Check and Enable GZIP compression
  3. W3 Total Cache Gzip Compression

You can also activate Gzip Compression using W3 Total Cache, please see the below screenshot.


3. Enable Gzip Compression through PHP File

This is an alternative way those mentioned above. for this you have to edit “index.php” file and then add the below piece of code at the very first after “<?php” like we have showed you a screenshot…

Gzip Compression with PHP File

NOTE: For better results, you should edit your main index.php file, not the index.php of your theme(s). Therefore, keep in mind that this required file will be overwritten next time you update WordPress, so you need to modify it again after an update.

Last Step for checking that however it works well or not?

Now after doing any one step of the above three, you should check it that it has been really enabled Gzip Compression on WordPress website or not. For properly checking it you can visit the below websites…

Check and Enable Gzip Compression with the below tools:

  1. http://checkgzipcompression.com/
  2. https://varvy.com/tools/gzip/

Final Words:

This is the detailed article on How to Enable Gzip Compression for your website. If you need any help for using any above method then you can ask us freely through commenting. You can also provide an other easiest method if you know… Kindly share this article with your friends using Social Media Sharing Networks…

Previous articleNewspaper v6.7.2 – Responsive WordPress Theme
Next articleSuperfly v4.0.4 Responsive WordPress Menu Plugin
JoJoThemes Developer Team do their best to share Free WordPress Themes, Professional Blogger Templates and other PHP Scripts. JoJo Themes always try their best to find best Premium WP Themes so that you could always Download files and could remain update with more latest updates. You can join us and follow us by visiting our following Social Media Pages.