How to Enable GZIP Compression in WordPress (3 Easy Methods)

How to enable GZIP compression in WordPress tutorial graphic

GZIP compression is one of the fastest and most effective ways to speed up your WordPress site. It reduces the size of text-based files (HTML, CSS, JavaScript) by 60–80% before sending them to the browser, resulting in significantly faster page loads, better Core Web Vitals scores, and improved SEO rankings. In 2026, with Google’s emphasis on speed and mobile-first indexing, enabling GZIP is still a high-impact optimization that many sites miss. At Cope Business, we enable and verify GZIP compression during every technical SEO audit service and WordPress speed optimization service we perform, often cutting load times by 1–2 seconds.
This guide covers three reliable methods to enable GZIP compression on your WordPress site—choose the one that best fits your access level and hosting environment.

Why Enable GZIP Compression?

  • Reduces File Size: Compresses text files dramatically.
  • Faster Load Times: Visitors download less data, especially on mobile.
  • SEO Benefits: Better performance improves rankings and Core Web Vitals.
  • Lower Bandwidth Usage: Saves server resources and hosting costs.
  • Easy to Implement: Usually takes just minutes.

Most modern servers support GZIP, but it’s often not enabled by default.

Method 1: Enable GZIP via Your Hosting Control Panel (Easiest)

Many hosting providers offer one-click or toggle options.

Steps

  1. Log into your hosting control panel (cPanel, Plesk, or custom dashboard).
  2. Look for “Optimize Website”, “GZIP Compression”, or “Performance” section.
  3. Enable compression for text-based file types (HTML, CSS, JS, XML, etc.).
  4. Save changes.
  5. Clear your browser cache and test your site with GTmetrix or PageSpeed Insights (look for “Compress transfer with gzip” in the results).

Best Hosts for This: SiteGround, Bluehost, Hostinger, and DreamHost usually have this option.

If your host doesn’t offer it, move to Method 2 or 3.

Method 2: Enable GZIP via .htaccess File (Most Common)

This Apache-based method works on most shared hosting plans.

Steps

  • Access your site via FTP (FileZilla) or hosting file manager.
  • Locate the .htaccess file in your root directory (where wp-config.php is).
  • Download a backup of .htaccess first.
  • Open the file and add the following code at the top (or just below # BEGIN WordPress):
text<IfModule mod_deflate.c> # Compress HTML, CSS, JavaScript, Text, XML and fonts AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/vnd.ms-fontobject AddOutputFilterByType DEFLATE application/x-font AddOutputFilterByType DEFLATE application/x-font-opentype AddOutputFilterByType DEFLATE application/x-font-otf AddOutputFilterByType DEFLATE application/x-font-truetype AddOutputFilterByType DEFLATE application/x-font-ttf AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE font/opentype AddOutputFilterByType DEFLATE font/otf AddOutputFilterByType DEFLATE font/ttf AddOutputFilterByType DEFLATE image/svg+xml AddOutputFilterByType DEFLATE image/x-icon AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/javascript AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/xml # Remove browser bugs (optional but recommended) BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html Header append Vary User-Agent </IfModule>
  • Save and upload the file.
  • Test your site with GTmetrix—look for “Compressing transfer with gzip” in the results.

Note: If you use NGINX (not Apache), contact your host to enable GZIP in server config.

Method 3: Enable GZIP Using a Caching Plugin (Most Convenient)

Many caching plugins enable GZIP automatically or with one click.

Steps

  1. Install a caching plugin:
    • WP Rocket (premium): GZIP enabled by default.
    • W3 Total Cache (free): Go to Performance > Browser Cache and check “Enable HTTP compression”.
    • WP Fastest Cache (free): Enable “Gzip” in settings.
    • LiteSpeed Cache (free): GZIP enabled by default on LiteSpeed servers.
  2. Activate the plugin and save settings.
  3. Clear cache and test with GTmetrix or PageSpeed Insights.

Best Choice: WP Rocket – it handles GZIP plus many other optimizations automatically.

Verify GZIP Is Working

After applying any method:

  1. Visit gtmetrix.com or tools.pingdom.com
  2. Enter your site URL
  3. Look for “Compress transfer with gzip” or “Enable compression” in the results
  4. Check the “Content-Encoding” header in browser dev tools (F12 → Network tab)

If you see “gzip” or “br” (Brotli), it’s working.

Final Thoughts

Enabling GZIP compression is one of the easiest and highest-impact speed optimizations for WordPress sites. Most modern hosts and caching plugins do it automatically, but manually enabling it via .htaccess or plugin ensures full coverage.
A faster site improves user experience, SEO rankings, and conversions.

Need help enabling GZIP, optimizing your full site speed, or resolving performance issues? Contact Cope Business for a free technical SEO consultation—we’ll make your WordPress site lightning fast.

Was this article helpful?
YesNo