Just like image compression, gzip compresses files on your website which makes it load faster. There are plugins you can install that will do this for you, however some plugins can actually slow your site down or break certain features.
The leanest way to compress files on your WordPress site is by adding some code to your .htaccess file. Editing your .htaccess file allows you to change the configuration on your website without accessing the server side configuration files. All you need to edit .htaccess is access to your cPanel.
You should make sure that your website is not already using gzip or brotli. You can run a test here.
Step 1: Log into your cPanel
Step 2: Click on “File Manager”
Step 3: Click on “Public HTML”
Step 4: Right click your .htaccess file
Step 5: Click “Download” and save a backup of your file
Step 6: Right click Your .htaccess file again, this time click “Edit”
Step 7: If this pop-up appears, click “Edit”
Step 8: Copy this code
Step 9: Paste it to the bottom of your .htaccess file
Step 10: Click “Save Changes”
You can run the gzip/brotli test again here. If the test does not recognize the compression, you can either wait a few hours and try again, or purge your website cache.
Now that you know how to speed up your WordPress site with gzip, why not sign up for our newsletter to get more tips every week?