Do Better on Google: Speed Up Your Site Load Time

SpeedWith Google now including page-load times in the factors it uses to rank sites for the natural search results, a recent article on the SEOmoz blog giving 7 ways to speed things up caught my attention.

Some of them I was already using but one that I wasn’t was Gzip compression, so I dived right in.

Compressing your site files before they’re sent from your server to the browser that’s viewing them reduces the amount of data that has to be transferred. And that speeds up page-load times – a lot.

It’s like using Winzip to compress Word or PowerPoint files before you email them.

As long as your server is running Apache you can follow these steps to activate compression and speed up your site load times:

Step 1:

In your WordPress root folder (the folder where your WordPress files sit) find and open the .htaccess file.

You may need to do this with your FTP client because some hosting provider file managers hide this file.

Here’s what it looks like using FileZilla:

HTACCESS file in FileZilla

Right click on the .htaccess file and the third option down is ‘view/edit’.

Step 2:

Select ‘view/edit’ and FileZilla will download and open the file with Notepad.

Step 3:

When the file is opened paste this entire block of code into it:

# compress text, html, javascript, css, xml:
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

Or, to compress certain file types by extension edit and use this (add the extension file types you want to compress):

<Files *.html>
SetOutputFilter DEFLATE

Step 4:

Once you’ve pasted that code into the file save and close it.

When you’ve closed it, FileZilla will ask if you want to upload the changed file back to the server:

Filezilla confirmation request

Step 5:

Click ‘Yes’ to upload it back to the server.

Step 6:

Once the file has been returned to the server you can click View>Refresh to see that the new file has been successfully uploaded.

Make a note of the file size before refreshing. After refreshing it will be around 500 bytes larger.

Step 7:

Disconnect from the server and close FileZilla. You’ll see a message that claims an edited file is still open and warning that if you close FileZilla your changes will not be saved.

As long as you verified that your updated .htaccess file has been updated (step 6) you can ignore this warning.

That’s it – you’re all done and your site visitors (and Google) will have a big smile on their faces.

Update – 3rd August, 2012:

The SEOMoz blog just released an updated article on ways to speed up page load times – this time there are 15 tips, although some of them are repeated from the article I linked to earlier.

You can find it here.


Martin Malden

The Jaaxy keyword research tool will give you that competitive edge

Comments on this entry are closed.

  • marvin 13 July, 2010, 8:16 am

    I added this to my .htaccess file and I think it did a good job on my site.

    Thanks for the tip..

    • Martin 13 July, 2010, 8:56 am

      Hi Marvin,

      You’re welcome 🙂



  • Cathy Miller 14 July, 2010, 8:51 am


    Let me ask a really stupid question-non-techie here-how do I know if my server is running Apache?

    • Martin 14 July, 2010, 9:06 am

      Cathy, hi,

      If you’re hosting on Hostgator you will be on Apache/Linux, and if you’re on one of the other more popular hosting providers, you will almost certainly be on Apache/Linux.

      If you’re running WP-Security-Scan (and if not you may want to check it out!) it will tell you if you click the first option in the menu: Security. On the right of the screen on the second line down you’ll see ‘server: apache ……….’

      If you’re still not sure then drop a quick line to your hosting provider.



  • Cathy Miller 14 July, 2010, 9:14 am

    Perfect-I have Hostgator-thanks. Martin!

    • Martin 14 July, 2010, 1:13 pm

      Excellent – you’re welcome!



  • Takuya Hikichi 27 August, 2010, 5:08 am

    Thanks for this tip. It really helped increase speed. Wow I was thinking I’d have to go turn off each plugin to see what was slowing down.

    • Martin 27 August, 2010, 7:04 am

      You’re welcome – glad it helped,



  • Frans 23 October, 2010, 10:10 pm

    This tip really helps me. According to Google Page Speed (amazing tool btw) it helped a lot. Google Page speed also gives suggestions on how to improve page speed

    • Martin 24 October, 2010, 7:44 am

      Hi Frans,

      Glad it was helpful,