• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
  • About
  • Contact
  • Subscribe
  • Advertise
methodshop

methodshop

tech news, reviews & how to's

  • Trending
  • Latest Stories
  • Fun
  • Culture
  • Learn
  • Tech
  • Search
You are here: Home / Learn / DIY & How To / How To Easily Enable GZIP Compression For Your WordPress or Apache Website
GZIP Compression
3844328, LOSTMIND

How To Easily Enable GZIP Compression For Your WordPress or Apache Website

One of the easiest ways to speed up your website is to enable GZIP compression. This is easily done and only requires adding a few lines of code to your server's htaccess file.

August 3, 2019 by Joe Michaels
Facebook0Tweet0Pin0LinkedIn0

A fast loading website is good for both your audience and your Google search results. That’s right, Google cares about your site speed, not just your content. And they will reward you with better search rankings because faster sites require fewer Google server resources to scan your site. One of the easiest ways to speed up your website is to enable GZIP compression. This is easily done and only requires adding a few lines of code to your server’s htaccess file.

Requirements:

  • A WordPress or Apache hosted website
  • cPanel or FTP access to your site files
  • Basic coding skills
  • 5 minutes of free time
Here’s how to speed up your website using GZIP compression … #GZIPcompression #WebsiteSpeed #WordPressWebsites #Website #WordPressSites

Click To Tweet

Run A GZIP Compression Test

Before you even start this process, it’s a good idea to first run a GZIP compression check. You might already have GZIP enabled on your website and not realize it. Sometimes hosting providers will make GZIP compression a standard part of your site install. Here are a few services that will test if you have GZIP already enabled on your server. Just input your website URL and wait for the results.

  • Gift Of Speed
  • Varvy
  • Nixcp

GZIP Compression WordPress Plugins

GZIP compression can easily be enabled by just adding a few lines of code to your htaccess file. And there are several advantages of doing it that way. If you are comfortable editing your htaccess file, then skip to the next section below.

But not everyone is comfortable with messing with code. The good news is, there are several WordPress plugins that can help you enable GZIP compression.

  • WP Super Cache: Settings > Miscellaneous > Compress Pages
  • W3 Total Cache: Performance > Browser Cache > HTTP compression
  • WP Rocket: An awesome, but premium plugin that also includes Cloudflare CDN. Compression is auto-enabled.

Advantages Of Adding Gzip Compression Code Directly To Your .htaccess File

Even if you are already using a caching plugin like WP Super Cache or WP Rocket, there are a few advantages of adding GZIP compression directly to your htaccess file.





  1. Reducing Plugin Conflicts: WordPress plugins sometimes conflict with each other and have to be disabled during troubleshooting. It would be a shame to disable GZIP compression, even temporarily, while working out your plugin issues.
  2. Increasing Website Speed: Although small, there’s still a speed improvement by calling the GZIP compression at the server level from the htaccess file instead of via a plugin.
  3. Reduce Opportunity For Errors: Another issue with using a plugin to control GZIP compression is an increase in potential conflicts. Caching plugins usually come with a lot of extra features that you may not need. If you only need a compression solution, then a plugin may just create additional data overhead.

How To Find Your .htaccess File

Before you can edit your htaccess file, you have to find it first. Your htaccess file is on the root level of your web server and can be accessed using several different methods including FTP or cPanel. Talk to your hosting provider about the best way to gain access to your htaccess file.

.Htaccess File
Accessing a “. Htaccess” using transmit ftp for macos.

Another thing to note is that the file might be invisible. Files that have a “.” in front of them, like a “.htaccess” file are invisible. Depending on how you are accessing your web server, you might have to enable an option that allows you to see hidden files.

How To Edit Your .htaccess File

Now that you’ve located your htaccess file, the next step is to edit it. You can either:

  1. Edit Option #1: Edit the file directly from the server or,
  2. Edit Option #2: Download it to your hard drive, edit and then upload and overwrite the old file

There are pros and cons to each option.

Option #1: To directly edit the htaccess file, try right-clicking on the file or look for another option that says edit.

Editing Your .Htaccess File
Editing a live. Htaccess file using transmit ftp for macos

Option #2: There’s an advantage of downloading a copy of your htaccess file to your computer. It creates a backup. That way if something goes wrong, you don’t have to try to recreate your htaccess file from scratch.

However, since your htaccess file starts with a “.”, the file might be invisible after you download it to your computer. Nothing is easy, right? So you’ll need to find that invisible file first before you can edit it.

On Mac, you can do a custom file search for invisible files from a Finder window. Just click on the “+” button and select “Visible or Invisible” under the File Visibility dropdown menu.

How To Find Invisible Files On Macos
Searching for both visible and invisible files named “htaccess” in macos

On a PC, check your Folder and Search Options. Make sure “Show hidden files, folders, and drives” is enabled under the View window.

Add The GZIP Compression Code To Your htaccess File

Now that you have your htacess file open, just copy and paste this code into it. Don’t overwrite any other piece of code. Just add this code to either the top or bottom of the file.

Alternate GZIP Compression Code

If you encounter any issues with the GZIP compression htaccess code above, then try this alternate code.

GZIP Compression Check

After you have installed the code in your htaccess file, the next step is to conduct a GZIP compression test. There are several great services that will test your site’s GZIP compression status. Just input your URL and wait for them to run a GZIP compression check on your website.

  • Gift Of Speed
  • Varvy
  • Nixcp
  • GTmetrix
  • Google PageSpeed Insights
  • WhatsMyIP

GZIP Compression htaccess Tutorial

That’s it! Hopefully, your final GZIP compression test was successful. Congratulations on having a faster website. What worked and didn’t work for you? Please tell us in the comments so we can improve this GZIP compression htaccess article in the future. Thanks for reading!

GZIP Compression WordPress Tutorial: How To Enable GZIP Compression For Your WordPress or Apache Website … #GZIPcompression #WebsiteSpeed #WordPressWebsites #Website #WordPressSites

Click To Tweet

Related Articles:

  • How to Force HTTPS By Modifying Your .htaccess File
  • How To Update Your WordPress Ping List
  • Disable WP-Cron.php To Speed Up Your WordPress Website
  • Gutenberg Sucks! Here’s How To Disable The New WordPress Editor

Related Posts:

  • How To Enable Amazon Seller Vacation Mode And Put Your Listings On Hold
    How To Enable Amazon Seller Vacation Mode And Put…
  • How To Enable iPod Diagnostic Mode And Troubleshoot Your iPod
    How To Enable iPod Diagnostic Mode And Troubleshoot…
  • Gizmondo Gaming Device To Enable Location-Based Advertising (2005)
    Gizmondo Gaming Device To Enable Location-Based…

Facebook0Tweet0Pin0LinkedIn0
Category: DIY & How To, Internet, Software Tag: GZIP, WordPress
Previous Post: « Best Mini Projectors (2019) 5 Best Mini Projectors For iPhone, Laptop, Streaming and Gaming (2019)
Next Post: 5 Most Popular Teen Shopping Websites (2019) Teens Using Smartphones »

Sidebar

Trending Now

  • The 30 Best Caddyshack Quotes That'll Make You LaughThe 30 Best Caddyshack Quotes That’ll Make You Laugh
  • How To Easily Create A PayPal Shipping Label Without InvoiceHow To Easily Create A PayPal Shipping Label Without Invoice
  • 7 Pictures Of Naked People Captured By Google's Cameras7 Pictures Of Naked People Captured By Google’s Cameras
  • 20 Famous People Who Are Members Of The Sleepless Elite20 Famous People Who Are Members Of The Sleepless Elite
  • Controversial Nimbus 2000 Vibrating Harry Potter Broomstick Has Parents In An UproarControversial Nimbus 2000 Vibrating Harry Potter Broomstick Has Parents In An Uproar
  • How To Play The Original Oregon Trail Game Online For FreeHow To Play The Original Oregon Trail Game Online For Free
  • Fletch Quotes: 30 Of The Funniest Quotes From The Movie FletchFletch Quotes: 30 Of The Funniest Quotes From The Movie Fletch
  • 5 Easy Elevator Hacks That Will Help Give You An Express Ride5 Easy Elevator Hacks That Will Help Give You An Express Ride
  • 15 Dirty Irish Pick Up Lines That Will Probably Get You Slapped15 Dirty Irish Pick Up Lines That Will Probably Get You Slapped
  • 20 Best Ferris Bueller Quotes From Ferris Bueller's Day Off20 Best Ferris Bueller Quotes From Ferris Bueller’s Day Off

Categories

COLD Podcast & Amazon Music

The COLD Podcast Gets Scooped Up In Exclusive Distribution Deal With Amazon Music And Has Been Optioned As A TV Series

Gina Carano Fired Poll

Was Disney Right To Fire Gina Carano From The Mandalorian?

After months of posting controversial messages on social media mocking pronouns supporting trans people, the 2020 election, face coverings, and Covid-19 lockdowns, The Mandalorian star Gina Carano got fired for her Instagram post about Jews in Nazi Germany that went too far for Disney.



About

MethodShop’s mission is to entertain, inform, and sometimes gross you out. MethodShop has affiliate relationships, so we may get a small share of the revenue from your purchases. Items are sold by the retailer, not by us. All prices are subject to change.

Latest

The Sunbather by Ohad Meromi

The 25 Weirdest Statues And Sculptures From Around The World

Perseverance Mars Landing Photos

This Incredible Midair Photo Shows The Perseverance Mars Landing From Above

Follow

MethodShop Animated Zoom Icon
  • About
  • Submit
  • Disclaimer
  • Privacy Policy
  • Contact
  • Subscribe
  • Store

Copyright © 2021 MethodShop · All Rights Reserved · Powered by BizBudding Inc.

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie settingsACCEPT
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled

Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.

Non-necessary

Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.

SAVE & ACCEPT