Article | Date posted : 30 September, 2013 | Updated on : 23 February, 2014

12 ways to speed up your wordpress site

Sponsored Links

How to turn a site that loads longer than 10 seconds in under 1.74 seconds! A fast performing site will benefit in organic ranking and advertising profits on your site. A while back ago I had a very slow performing WordPress site. It was loading longer than 10 seconds. Me thinking it had to do with the server I got in contact with Media Temple, they suggested that the cause was the theme I was using. After investigating the theme I used, I noticed it was loading 127 resources and that is too many to load effectively.

Most popular browsers will load anything between  4 to 8 resources, taking the average into consideration (6) it would take a browser 22 steps to load all the files and if you have a couple of large files, you will notice that the pipes will clog up pretty quickly.

So my first step was to find a fast theme that was newly build.  I stumbled upon Pravda, a theme that was very quick.

But it was not quick enough.

So what did I do?

After researching lots of articles, I have done the following which can be done to any Theme and will improve 80%, as my site now loads in under 1.74 seconds.

As of 17 December 2013 I have built my own theme and have successfully maintained a fast website. I wanted to step away from something I did not build myself. So now with the successful launch

Step One: Choosing The Right Theme

Find yourself a good and quick theme. I would suggest using Pingdom Web Speed Test and test out the theme demo that is ready available from the creator. Don’t just test one theme, test several different ones that you like.

Do the test using the different servers available on pingdom such as New York and Amsterdam. Do the tests multiple times during the day. So that you can view the overall historic performance. If you only test the demo once, you might encounter inaccurate ratings. Sometimes site servers might get overloaded and perform slow, or there might be a big fish in the pipe.  😛

pingdom speed test

Step Two: CDN Network

After you have found yourself a new site, or if you want to optimize your site without using a new theme than get yourself a CDN Network. A CDN network is a worldwide delivery system which loads resources from the nearest server and not from one server where your site hosts. I use Cloudflare because its free and its an amazingly great company. The support is great and the applications are even better. When using Cloudflare with WordPress I recommend disabling its features for your WordPress Admin panel, as it interferes when WordPress is taking a longer time then usual to update your MySQL database. You can do that easily by adding a page rule.

Select the gears on the right > Page Rules

cloudflare step1

cloudflare step1


Add your page rule URL by typing **

Disable all apps and rocket loader.

cloudlfare pagerules

cloudlfare pagerules

Enable css, js and html minify compression.

RockeLoader can speed up a site by 10 fold. Unfortunately it does not work well with all scripts due to some issues which I’m still trying to understand. Once understood I will update this article

What Rocket loader does for you is asynchronous resource loading. This means that it will load your JavaScript resources after the first page loads which effectively turns a page that loads in 12 seconds into 2 seconds.

Step Three: Caching

Install the plugin W3 Total Cache and minify your html and your css. I would not minify your JavaScript as it will combine all the scripts into one file. And most likely mess up your functions on the site. But this is where CloudFlare comes into play. With its auto minification in Rocket Loader, it will take care of everything.

Another reason I don’t like to use W3 Total Cache for JavaScript is that it places the newly merged file in the head of the page, while Rocket Loader places everything at the bottom, as it should do.

Step Four: Image Reduction

Yahoo in the recent years has bought, I highly recommend sending all your images into the upload system to re sample your images. Once you have re sampled your initial batch of images. Use the WordPress plugin WP to automatically re sample all your images on the fly.

Step Five: Cleaning Up

Remove unnecessary plugins, the more plugins you have the more resources it will need to load. If you are able to edit your resource files. Than remove scripts and css styling if you’re not using it. And enable resources when needed such as only on the homepage or only on posts.

Another problem is using remote API’s, with remote resources you are always reliant to them. For example as cool as AddThis is, it’s another script that will delay your site by as much as 2 seconds. I have removed the plugin from this site. It’s just another time waster. Look for social plugins that are hosted on your own site, so that your CDN and W3 Total Cache can do the rest to lower your site load.

Another great method for social plugins is to have  information or actions loaded upon hover or page scroll. Which means that on the initial page load this social plugin is not included. There is already one plugin that does that WPSocialite

Step Six: Reduce Image Page Load

Reducing the amount of connection is another great step in optimizing loading time, as mentioned before a browser can open anything between 4 and 8 connections. Which means if you take the maximum connection ports as an example (8) to load 16 images, it would have to wait 8 times before all images have been loaded. So how can you cut down on loading requests?

You can do this by only allowing images to be loaded that are visible in the viewport, there is already a plugin that will do this for you with ease called BJ Lazy Load.

Can Google crawl these images?

This Lazy Load plugin will set-up all images correctly, so that Google can crawl your images. Other plugins might not be crawl-able. When testing the plugin ensure that the src of the image is intact. Meaning that the full path to the image is available.

Step Seven: htaccess

There are several more things you can do to speed up your website and that is by adding a few lines into your .htaccess file.

The first one is gzip, Gzip is an automated feature that enables all the compression of the files such as plain text, css, xml, javascript etc…

The second part is enabling the expiry date of images and the css file. Setting the value of 290304000 seconds before your images expires. This also will not only help speed up your site, but also your ranking. Due to the likely hood of your image being expired. Lets look at it from Google’s perspective.

If an image expires the next day, it will not want to crawl it for Google Images, as it will know it will be gone the next day. If instead it knows it will expire in 6 months or a year, it will take action and crawl the image.

If you don’t know how to edit .htaccess files than simply open your favorite ftp program and look for the file in the root of your domain, download the file to your desktop and open it with basic text editor. Don’t use any other types of programs as these programs will add embarrassing elements you don’t need.

Once opened simply add the above code to your file. And simply save.

Before uploading this newly created file, re-download your htaccess file as a backup copy, so that after uploading the new one and all hell breaks loose you still have a way of recovering what you have done wrong.

Step Eight: Prevent Hot Linking

As every body might or might not know is, when you post a topic or a page regardless of what platform you are using. Can be hot linked. Hot linking is where a remote server or site will link to your images. This would not be a problem if only a handful do this. But the problem starts when you have thousands using your images. This will increase your server load and cause slow loading. To prevent this you can easily add the code below into your htaccess file to block images from being hot linked.

BE WARNED, this will cause a negative effect for your SEO. Think linking images as a real link to your website. Google will treat each link or images in a similar way, I would not know the weight ratio of page rank that flows through but it will be a good page rank factor to have for your site.

So instead of blocking hot linking, maybe invest in a better server or CDN.

Some people may think, well why not just use a dedicated server and load the images from an alternative resource, for example like CloudFront, well the problem with that is that the page rank juice will not go to your site, but to the cloudfront. So you’re not really going to benefit unless everything is hosted under your own domain name.

You could host the images on a sub domain, and have a superior server on to that domain, but I have no experience to see if images hosted on a sub domain will help the main domains page rank. Something I might test out one day.

Step Nine: Changing your styling images to inline SVG or BASE64

Every image you have on your page or on the site is an extra resource the browser needs to load. You can now easily convert your (vector looking) images to SVG format and copy the core code into your html document. This is not for images inside your post article, but the styling of your html document.

For example, a logo, background pattern, repeatable images that are build into your html document.

An SVG file source code is a an opening and closing SVG tag with inside several path lines <svg><path></path> </svg>

Changing the img tag from an external source to an internal source will reduce the load requirements of your browser by one, which means that all other files can be loaded quicker.

I have written a great article how to convert your images to SVG, re size them and how to copy the source code to your html document using open source tools

Base64 is an encoding and decoding algorithm that browser understand, you can easily convert your jpg/gif/png images to base64. The coding itself will look something like the following. Do note I have made the code smaller just for demonstration purpose.

To include a base64 inside your blog post, you simply add your image as you do normally. Than convert the same image using an online base 64 converter tool. Than copy the src of the image and go back to your wordpress editor. Switch to text and simply replace between the double quotes the original image with that of the base64 src=””

The image that you see above is using the base64 image format.

Using inline base64 is one of my worst suggested improvements. I have spent the last two days in testing my argument that base64 could improve your website speed. With the tests that I have done, I have concluded that I was wrong and that simply optimizing your images is much faster than inline base64.

Step Ten : Do you have multiple advertisements on a page?

I’m taking Google Adsense as my example, now do you have multiple ads on your page? Have you ever asked yourself why you are loading the same javascript resource file with each ad? You really don’t need to load the googlesyndicate source file with each ad placement. Simply place your script at the footer of your page just before the closing body tag.

And wherever you want to place your ad, simply include the following

This will cut your total resource count and cut your page size by 86 bytes per extra ad.

This might sound like your reducing a grain of salt but in fact if you have 10,000 views per month. That means you will save 8.6 mb. It might seem insignificant but every penny is worth a thousand in my world 😀

Step Eleven

The database that is running behind WordPress can at any point become one of the most complex parts of the site. Post revisions, trashed articles, spam comments and even the database overhead can get larger. Sometimes when WordPress is running tasks it needs to use some extra disk space, when the disk space becomes to large all queries will become slower, even if you have no overhead and you leave all your spam, revisions, trash in your database than the same happens that all your queries will become slower. It is advisable to cut these negative elements. The easiest way is to use a plugin named WP Clean Up.

Step Twelve

I have mentioned before that you should remove unnecessary plugins. Today I have discovered a tool that highlights how slow certain scripts are, you can see how long it takes for each resource to be loaded and compare it to other scripts on your site. It is another plugin to install, but you can use it and delete it once your happy optimizing the speed of your site. For example I have realized that Crayon Syntax Highlighter was actually taken up a lot of resources. So I have removed it.

Bottom Line

And this ladies and gentleman is how I turned my site to a super fast loading environment. I hope you all have had a great read.

Any questions or suggestions, please leave me a message.

CDN networks do receive country localized 502 bad gateway errors (fixed within seconds), I’m actually fine with that. If I get an error only a couple of times a month versus a site that loads longer than 10 seconds. Than i’m going to choose for a CDN network.

If you think about it, loading a site that takes longer than 10 seconds is not acceptable for anybody. I would close down the browser and not bother opening the link anymore. So I made up my mind. What are you going to do?

Sponsored Links


8 thoughts on “12 ways to speed up your wordpress site

  1. Hi Emmanuel.

    After getting rid of the Intense Debate plug in my load time improved by 60%. Unreal!

    Lose the dead weight. If some plug in holds back your load time and diminishes performance get rid of it – and its poor cousins – immediately.

    Thanks for sharing!

    1. All you want is self hosted plugins. At least than you have more control over the load times. I installed Intense Debate too because I loved the way you are able to reply with all social platforms. Hopefully one day i’ll have time to build one myself for self hosting purposes.

      Glad you found my article useful.

  2. Nice Tuto..and I following right now… by the way I m having a strange problem,,,on my blog:

    Open it … with Adblock extension and then open it without Adblock… My Slider and also “What’s New” section also getting disappeared without adblock..

    I m trying to find a way to it.

  3. Hi Emmanuel,

    Great post. I have already started implementing many of them. I am facing an issue and was wondering if you can help me. When I try to enable the expiry date of images and the css file by adding the recommended code in .htaccess file for FantasyLogic, the site crashes and get an internal server error message. Any ideas?

    Thank you in advance.


    1. Hi George, You can try the following, remember that if you change htaccess settings to always have a backup. And even if possible to test it on a beta site, rather than the live site.

      Try this

      ExpiresActive On
      ExpiresDefault “access plus 10 days”
      ExpiresByType text/css “access plus 1 week”
      ExpiresByType text/plain “access plus 1 month”
      ExpiresByType image/gif “access plus 1 month”
      ExpiresByType image/png “access plus 1 month”
      ExpiresByType image/jpeg “access plus 1 month”
      ExpiresByType application/x-javascript “access plus 1 month”
      ExpiresByType application/javascript “access plus 1 week”
      ExpiresByType application/x-icon “access plus 1 year”


Leave a Reply

Your email address will not be published. Required fields are marked *

Follow me on Google+

Google Shopping Data Feed Generator

Sponsored Links

Hire Me