Enabling gzip compression on your site will dramatically reduce the amount of data sent from your server to the visitors browsers, thus increasing the page-load speed.
The top 3 benefits are:
- A better user-experience: no one likes to wait 10 seconds for each page to load
- SEO bonus: search engines too prefer sites that load faster
- Reduced server load: your server will no longer have to process large requests
How to enable gzip with WordPress?
A few plugins include gzip activation, but my preferred and surefire method is to add a few lines directly to your .htaccess file.
Please, DO KEEP A BACKUP of your .htaccess file before you mess with it!
If you are used to get your hands dirty and manipulate files via FTP, you know how to proceed.
If you would rather stay within your WordPress dashboard, then this free plugin will let you simply edit your .htaccess file through wp-admin: WP Htaccess Editor
A typical WordPress .htaccess file should look like this:
# BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress
To enable gzip compression, simply add the following at the end of the file:
# compress text, html, javascript, css, xml: 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 AddType x-font/otf .otf AddType x-font/ttf .ttf AddType x-font/eot .eot AddType x-font/woff .woff AddType image/x-icon .ico AddType image/png .png
And that’s it!
You can test the result directly with your browser developer’s tool (inspector), or by using some online tools such as: HTTP Compression Test. Just enter your site’s URL, and it will tell you if it is actually gzipped, and if it is, you will see the impressive compression ratio.

If you want to know more about gzip compression, how it works and why it’s great, then you will enjoy reading this nicely explained article on betterexplained.com: How To Optimize Your Site With GZIP Compression
Thanks for sharing. It worked like a charm 🙂 PageSpeed is 95 🙂
thanks i got 74% data saving after gzipping my wp site.
Go to http://www.yourdomain.com/wp-admin/options.php
find gzipcompression and change value 0 to 1
This option was actually available in the Settings section up to WordPress 2.5, it was then removed because it relies on a php implementation, which is far less effective, and not recommended.
Apache/Nginx handle it far more efficiently, thus why using .htaccess to enable mod_deflate or mod_gzip is far more effective and the most recommended way to go about this.