How to enable gzip compression in WordPress using htaccess file

If you want to improve your WordPress site’s page speed score, try enabling gzip compression. You can simply do it without any additional plugin.

how enable gzip in wordpress

So How Can You Enable Gzip without Plugin?

First connect your site using ftp client and download your .htaccess file then copy below code and paste it in your .htaccess file. Paste the code at top of the page, save it then upload back to your site. You are done!

#Gzip - compress text, html, javascript, css, xml
<ifmodule mod_deflate.c>
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
</ifmodule>
#End Gzip

Was this post helpful?

Tags
Show More

Related Articles

Back to top button