How To Optimize Your WordPress Blog

How to optimize your WordPress blog? I promised you in the last post that I would tell you how to optimise your blog so that you can increase its speed and at the same time keep Google happy. Before optimising this blog and moving it to a VPS host for WordPress, it used to take over 12 seconds for the page to load fully. Now it takes around 3 seconds. You have to admit that is a pretty big difference. This post will be the first of a series of posts that will explain how it did it. The first step was to resolve the issues supplied by Google’s Page Speed Insight. The initial scan of this blog showed that as far as Google was concerned, I had some high priority issues to resolve.

How To Optimize Your WordPress Blog

High priority. These suggestions represent the most significant potential performance wins for the least development effort. You should address these items first: Serve scaled imagesLeverage browser cachingEnable compressionOptimise images

For this post, I will show you how to resolve these issues starting with serving scaled images.

How To Serve Scaled Images

A scaled image is when you’re displaying a scaled-down version of a full-size image that you host on your blog. A scaled image occurs when you reduce the size of an image so that it fits within the confines of your post. Many sites scale down their pictures to fit in their sidebars or to display a smaller version of the original one. The problem is that although people think that they’re conserving bandwidth and increasing speed by doing this, they’re not because the server downloads the full image before displaying the scaled-down one.

The solution is to only display images in the actual size you want by resizing the image offline and then uploading it back to your blog. Now when people access your site, they’re only downloading the smaller picture, thereby increasing blog speed. Once I did this that warning disappeared.

How To Leverage Browser Caching

What Google wants us to do is to set an expiry date because ‘Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network.”

Unfortunately, Google doesn’t show us how to do this. I searched for ages on the net and tried many plugins to resolve this issue. However, none of the plugins I tested worked. I wasn’t having much luck on the net either until I came upon this post, How To Leverage Browser Caching In Apache. Unfortunately, that link no longer works so I’ve removed it. Luckily I copied the code down below.

What I did was to add the following code, just as the post suggested, into my .htaccess file and that resolved the second issue.

# Begin Leverage Browser Caching
Header unset Pragma
FileETag None
Header unset ETag
<FilesMatch “.(ico|jpg|jpeg|png|gif|js|css|swf|pdf|flv|mp3)$”>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault “access plus 14 days”
Header set Cache-Control “public”
<FilesMatch “.(html|htm|xml|txt|xsl)$”>
Header set Cache-Control “max-age=7200, must-revalidate”
# End Leverage Browser Caching

Just keep in mind that the VPS Server I’m hosted on uses Apache and I made sure of that before making these changes.

GZIP Compression On WordPress Optimize Your WordPress Blog

Most people know that it’s a lot easier to upload or download a zipped file than an uncompressed one. This is because the zipped file is so much smaller. The same applies to websites which is why Google is looking to see if sites have it enabled. Naturally, the first thing I tried was the WordPress plugins, but although I didn’t get any error messages as far as Google was concerned, there was no compression of my blog. Damn! 

Oh well, I may as well resort to Googling to find an answer, and after a long search and many trials, I came across How To Enable GZIP Compression On Apache. Once again, take note, your server has to be running Apache for this to work! This is the code I added to the .htaccess file.

# Enable GZIP
<IfModule mod_mime.c>
AddType application/x-javascript .js
AddType text/css .css
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/css application/x-javascript text/x-component text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/javascript
<IfModule mod_setenvif.c>
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
# End GZIP

I went back and tested it with Google and much to my delight I had resolved another issue. If you want to check to see whether or not your site is compressed I found a site that will do a Http Compression Test.

Optimise Images For Your Blog Optimize Your WordPress Blog

The Google Page Speed Insight checks your site for optimised images because it knows they make your site load faster. After all, an optimised image is much smaller than the original. Luckily there is a WordPress plugin that will do that for all your images in the media file, WP Unfortunately not all my images are in that file, but luckily I found a website,, which allows you to optimise your images online. Better still, they had available a free tool for download that will let you optimise single files or even whole directories. That was a much better option. I downloaded my image directories, optimised them and then uploaded them again.

To improve site speed even further, I downloaded the images from advertisers, optimised them and then uploaded them to my server. A much better option because there are times when the host site is down, which then slows yours down as it tries to retrieve the image.

That’s it for this session. If you found this post helpful, you may want to promote it via your favourite social network.

Now that I’ve ex[laned how to optimize your WordPress blog I would love to know if these tips worked for you, and if you have any other ideas, we can use to make our sites go faster. You know the drill, leave a comment if you like to add to this post.

Other Topics You May Find Interesting

My YouTube channel has heaps of interesting stuff. Check out my How To Leave Great Comments On YouTube video. If you love to laugh, there are my Laughaholics videos. There are some hilarious videos there that I know you’ll get a kick out off. You’ll especially love my latest Funny Cowboy Joke video. While you’re there why not join my growing YouTube Channel. As you know I’m always looking for new subscribers so why not consider subscribing to my My Bonzer Channel

Leave a Reply