Daily Tips SEO WordPress

How to: Enable gzip Compression WordPress

0
0 0

When we are talking about Search Engine Optimisation we are talking about website speed, fast page loading which means high performance. One, very important fact to improve the loading speed of your website is to enable gzip compression.

But, wait a second: What does the gzip compression really does to your website? GZip is a form of data compression. For example it takes a chunk of data and makes it smaller. The original data can be restored by un-zipping the compressed file. For detailed informations regarding GZip compression and how it works please check this stackoverflow post.

Step 1: Open functions.php inside your theme’s folder.

Step 2: Copy this piece of code at the end of functions.php you opened at Step 1:

if(extension_loaded("zlib") && (ini_get("output_handler") != "ob_gzhandler")){
   add_action('wp', create_function('', '@ob_end_clean();@ini_set("zlib.output_compression", 1);'));
}

Final note: By default your server should have this feature enabled. But if you are on a shared hosting most probably it is not enabled(probably to increase client bandwidth usage, just saying);

Have you enjoyed this article? If so please share it on Facebook or Twitter!

Thank you

Stanley
I am a self made webmaster, blogger, web technology enthusiast and founder of StanleyTips.com.
You may also like
Top 10 jQuery Gallery Plugins ready to be used in projects 2016
Most Attractive WordPress Blog Magazine Themes

Enjoy This Article?

Join My Mailing List...

Facebook

Twitter

THANK YOU