GZIP Compression is one of the best method to improve Page Speed of your WordPress blog, Remember Page Load time plays an important role in Search Engine rankings, therefore it’s always advisable to compress the content, GZIP Compression sends compressed pages from the server to browser.
You can enable GZIP Compression by using WordPress plugin but remember a Plugin will always consume some resources and it itself can reduce the load time.
Benefits of GZIP Compression-
1.Increases the Page Speed,which will surely help your Readers and Visitors.
2.Decrease the Page Size which will obviously save Bandwidth.
3.Search Engines prefer to crawl and index sites of smaller size.
How to Enable GZIP Compression In WordPress
It’s Simple you have to only add the below code in your WordPress .htaccess file and you have done with GZIP Compression-
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
# Or, compress certain file types by extension:
How to Find .htaccess Files to enable GZIP Compression in WordPress Blog:
1.Default-If you are using cPanel,open the cPanel and then Navigate to “File Manager” > Tick on “Show Hidden files (dotfiles)” and select “Web Root(public_html)” >> Click on “OK” >> You will see .htaccess there add the above code in it, better add it in the end.
2.Yoast SEO Plugin-If you are using Yoast SEO Plugin you can easily Edit your .htaccess files,Just Navigate to Plugin Settings Tab i.e, SEO tab>Edit Files here you can edit .htaccess files.
3.If you are using Security plugins-Lots of Security Plugins edit the .htaccess files and take over the control to it,In that case you will have to find the settings by yourself however we have used BPS security and if you are also using it,you can edit the .htaccess files in it using the htaccess file editor.
The above method will work for most of the people as they are on shared hosting which are using Apache mostly and the other popular one is NGINX where you can’t configure GZIP Compression like this,you have to configure GZIP Compression from the server config file,if you are on shared hosting or a managed hosting which is using NGINX ask your provider for the solution.