Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Turn On GZIP Compression for WordPress

This guide shows how to shrink your site's files on the way to visitors, so pages load faster.

Speed and Performance2 min read19 steps

What is GZIP?

GZIP is a way of squeezing files to make them smaller. It is like packing clothes into a vacuum bag before a trip. The server squeezes the page, sends the small file, and the visitor's browser opens it again. Smaller files travel faster, so your site loads sooner and uses less bandwidth. Bandwidth is the amount of data your site sends out.

Many servers already have GZIP on. You can test first to find out.

Step 1: Test if GZIP is on

  1. Search the web for a free GZIP compression test.
  2. Type your site address in the box.
  3. Run the test and read the answer.
  4. If it says compression is on, you are done.

Step 2: Use a plugin

A plugin is a small add-on that gives WordPress extra features. Many caching plugins have a GZIP switch.

  1. Log in to your WordPress dashboard.
  2. Go to Plugins and then Add New.
  3. Install and activate a caching plugin such as WP Super Cache or LiteSpeed Cache.
  4. Open its settings.
  5. Look for an option named Compress pages or Enable GZIP compression.
  6. Turn it on and save.

Step 3: Use the .htaccess file

The .htaccess file is a small settings file that sits in your website folder. It works on servers that use Apache. Ask Hostvento support if your plan uses another type of server.

Warning: A mistake in this file can make your whole site show an error. Download a copy of the file first so you can put it back.
  1. Log in to cPanel from your Hostvento client area at https://secure.hostvento.com/clientarea.php.
  2. Open File Manager.
  3. Go to the folder where WordPress is installed, often public_html.
  4. Click Settings at the top right and tick Show Hidden Files (dotfiles). Click Save.
  5. Right-click .htaccess and choose Download to keep a copy.
  6. Right-click it again and choose Edit.
  7. Add this block at the end of the file:
    <IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/css text/plain
    AddOutputFilterByType DEFLATE text/xml application/xml
    AddOutputFilterByType DEFLATE application/javascript text/javascript
    </IfModule>
    This tells the server to compress web pages, style files and script files.
  8. Click Save Changes.
  9. Run the GZIP test again.

If your site breaks, restore the copy you downloaded.

Quick recap

  • GZIP shrinks files so pages load faster.
  • Test first, because it may be on already.
  • Turn it on in a caching plugin, or edit .htaccess.
  • Back up .htaccess before you edit it.
  • Test again after the change.