WordPress Guide: Howto Force Your Blog Load Fast

Load time of the WordPress blog is one thing that many bloggers strive to achieve in order to sustain the mass number of visits. And while we do have some control over some of the factors that can greatly help you speed up your blog – you will need to make decisions you might not like …

In this post I’m not going to cover detailed info on caching etc. There are plenty of other posts that explain how to create a minimalistic WordPress blog that loads super fast. I’m here to share how to run a Web 2.0 enabled WordPress blog and still have it load reasonably fast!

Before I even begin to talk about the ways to speed up your blog I want to mention one thing that is perhaps the biggest determining factor for your blog speed.

Good Hosting. Not all hosts created equal and when it comes to shared hosting – you will find that one host greatly differs from other. I personally tried several and right now I’m sticking it with Hostgator, who provides one of the best combinations of dependability, support and uptime for a shared hosting. While VPS (virtual private server) with dedicated bandwidth and resources is even better option – truth is that majority will not need it r can’t afford it. This blog is used as testbed for my own product and I run it on shared hosting for one main and biggest reason – I need to be able to test something that I share with my customers in Real Life Environment Under Similar Conditions!

With that being said – I choose Hostgator because so far it has proven to be stable, reliable and cooperating Host!

Say NO To Caching Plugins!

Are you surprised? The beauty and flexibility of the WordPress lies in its ability to instantly deliver a user generated content (comments, feedback, rating, etc). While caching can be a solution for the short periods while your blog is overrun by traffic from Digg or Stumble, if you have to do it on permanent bases I would start looking for a new host as it means you get enough traffic to generate income and afford a VPS or a more dedicated hosting.

And here is why I say it.

Many plugins rely on most current data and using caching plugins simply makes them generate incorrect values or simply force them to stop working! A few examples of that would be Popularity Contest, Dagon Design Form Mailer, Post Ratings, etc … Any plugin that would need latest and most current data. If you don’t use them you might be ok.

Set Baseline

Page load time greatly depends on factors directly impacting the person who is trying to access it, such as Internet Connection speed, how modern is the computer, how modern is the software needed to access the site. Also additional factors on your blog greatly impact the speed and something I can’t help you with outside of giving some generic advise: size of the images used on your blog, number of external widgets used in sidebar, number of external scripts running on your pages…

But there is a way to determine “independent baseline” you can use to actually KNOW how fast your page is loading. We will base it on the speed of page being generated on your server. With all other factors out of the view – How Fast Does Your Host Generate Your Page is one aspect that will be constant to all and one we will use for our optimization.

If you look at the source code of any page on my blog – at the end you will find this info (see image below):

And here is an explanation to what you see:

Number of queries to database that had to be made in order to generate that page

How many seconds it took the server to perform the queries and then generate the page.

In order for you to establish similar Baseline you will need to open Admin->Presentation->Theme Editor-> footer.php and add this line right before </body> closing tag:

Please do not Copy/Paste above but type it out in notepad for the code to work!

Optimize Your Plugins

I love plugins and in my personal opinion without them WordPress would not be same platform and I would probably never use it. Plugins are what turns your blog into a more interactive platform, enhanced existing functionality and even introduces opportunities that didn’t exist before…

But plugins are also what is greatly responcible for the extra time in loading speed. If you are forced to evaluate ways to speed up your blog – plugins are on of the areas you can use to control it. As you activate plugin several things CAN happen (not always) :

Each plugin will make queries to database, adding to load speed and time required to generate the page

Some plugins will insert Javascript into header, this adds to general page load time

Some plugins will insert CSS styles code or link to stylesheet into header, also adds to general load time.

You have several options here. You can deactivate all plugins and then activate them one by one and after each refresh your baseline page and see how it impact the number of queries and generation time or you can deactivate one plugin at the time and then do a few refreshes of baseline page.

Try to identify plugins that add the most to number of queries and load time. Even if you don’t disable them right now – you might do so later… at least you will know which are the resource hogs on your blog.

Optimize Your Widgets And Sidebar

As you do your testing you will find that External Code or just external widgets are the biggest offenders when it comes to load time of your blog.

While this decision is entirely up to you – I recommend you have a long and hard look at what widgets with external code you MUST have on your blog…

If possible, optimize ads to display images locally. If you are using Sponsor ads, see if you can obtain the image that sponsor wants rotated and have it displayed from your server. This will reduce the load time quite a bit if the option is OK with the sponsors. Sometimes they test the results and wouldn’t want to allow you that.

Optimize your images for size. Using some form of software to optimize your images for the web is a must. Sometimes a differences that you can hardly see with an eye can reduce the file size by twice when properly done. Analyze your pages and see what images are there and if there is a way to optimize them.

Evaluate Internal Widgets. Some widgets we use to display content for the internal pages can add quite a few queries to database and simply removing one widget can cut the load speed. This is the time when you have to evaluate the functionality versus the speed. Experiment on your blog and see how each widget impact the number of queries and load time and then decide if its a keeper or should be gone.

Few Other Tricks

While what I have described above should help you get started there are a few more advanced options available. Some of them were covered by me previously and some were written by other authors and well worth your attention if you are looking to add some speed to your blog:

Keep in mind that load time can greatly differ on host, time of day, etc … there are just way to many variations to be able to predict them all.

Goal of this article was to help you make your own decision based on performance. It is also assumed that you will do the due diligence and test your blog at different times and under different conditions.

Alex, This is great information. Using the load time baselining tip you gave, I found one plug-in that was adding a whole 1 second to my load time. It might not seem like a lot, but when you go from 1.3 sec load to 0.3 sec load, it is.

I use HostGator too and they’ve been pretty good. There are times when my server seems to be more bogged down than others. I assume its the other sites on my server and I guess that’s just something you’ll get with any Shared Host service.

My theme has the same out for the baseline as yours, but it was already there – I didn’t have to add it. I think I’ll leave it as I like to keep an eye on it…

When people are checking the baseline, one tip is to check a post with a lot of comments. Sometimes a post with only a few comments is nice and quick, but one with a lot of comments is slow…

A blatant plug: If external widgets are slowing down the page loading time, you may like to check out my IFrameWidgets plugin. This will add a little more processing to the server, but will help the browser load the page faster once it’s been served.

I added the php code to the footer to check the queries and load times. My load time has been very slow using godaddy.com with shared hosting. I just turned on the wp-supercache plugin and it seems to be helping tremendously. Wouldn’t adding the extra queries to the footer to check the load times actually slow down your load time?

Yes, adding code would add to queries. That is why I stated to remove it AFTER you are done.

wp-super-cache is great but I don’t like using it and I don’t think under normal conditions it should be used.

Alex

Mark on February 3, 2009 at 4:11 pm

Hi, may I ask what the reason is that wp-super-cache shouldn’t be used under normal conditions? I’ve just set up my first blog (still in testing mode) and after reading so much positive news, I installed wp-super-cache. I’m curious why you think it’s not good and why you don’t like to use it. And don’t you like to use the standard wp-caching-plugin also?

Recent Posts

Affiliate Disclosure

You should assume that the owner of this website is an affiliate for providers of goods and services mentioned on this website and may be compensated when you purchase from a provider. To learn more, click here | Legal