alex sysoef

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):

load speed

And here is an explanation to what you see:

  1. Number of queries to database that had to be made in order to generate that page
  2. 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:

<!– <?php echo get_num_queries(); ?> queries. <?php timer_stop(1); ?> seconds. –>

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:

Filed under WordPress
Tags: , , , ,

28 Responses to “WordPress Guide: Howto Force Your Blog Load Fast”

  1. Chad says:

    Good stuff Alex, thx!

  2. So glad you posted this, Alex.

    Especially the code to display loading speed. Assuming you are
    happy with your loadtime figure above, my webhost is doing
    well for me.

    Thanks
    Gary Harvey

    Find Hot Markets Blog’s last blog post..CPA Goldmine

  3. TheSpot-er says:

    Thanks guys,

    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

  4. Louis Liem says:

    I dumped my caching plugin the first time I used it.

    I asked myself why my layout wasn’t changed after I altered my css. Centuries later -luckily, I’m smart enough to- found out that I had been staring at the cached version all those time!

    Louis Liem’s last blog post..Google Myths – Are Any of Them is True?

  5. TheSpot-er says:

    Thanks guys,

    glad my free guide is helping people :D

    Alex

  6. 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.

    Thanks!
    Charly.

  7. I just added this article to the ToDo lists of all my WP blogs. I wish every WP theme designer/widget developer would read this guide before going to work.

    Malte Landwehr’s last blog post..Wohin steuert eBay?

  8. TheSpot-er says:

    One thing I should have mentioned here:

    Remove the code I provided when done!

    Just a reminder that once you are happy with your blog optimizations results, remove the code as it ads 2 more extra queries to database – that gives you a chance to gain some more speed.

    Alex

  9. Great Post!

    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.

    Stephen Cronin’s last blog post..New WordPress Plugin – KeywordLuv

    • TheSpot-er says:

      Thanks Stephen,

      I don’t know about iFrame but your KeywordLuv is definitely worth mentioning and I just posted about that plugin!

      Alex

  10. ElectroGeek says:

    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?

    ElectroGeek’s last blog post..Raon Ultra Mobile PC Weighs only 1 Pound

    • TheSpot-er says:

      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 says:

        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?

        Thanks!

        • TheSpotter says:

          No you can use it. When the post was written – there were many plugins incompatible with wp-super-cache. Issue is lot less now and if you have one of those plugins – you will see it yourself.

          Alex

  11. Rajesh says:

    Hmm I got this
    In My Site…. :( Really I want to speed up My Blog..

    Rajeshs last blog post..[Webmaster] Improve Page Rank And Boost Your Alexa Rank In No Time

  12. Andrew Keir says:

    Your definitely the first person I’ve heard say not to use a caching plug-in. If your blogs popular enough to need high end web hosting you don’t think the plug-ins still usefull with a short refresh time at all?
    .-= Andrew Keir´s last blog ..25 logo design trends for 2009 =-.

  13. OdoacrO says:

    Thanks for the tips man!
    .-= OdoacrO´s last blog ..Adobe CS5 Trials Download =-.

  14. More important than ever if site loading speed is factored into page rank. Google, I hear, is. Likely others to follow.

  15. Neil says:

    Thanks for the tips, think I have a problem with the size of my background though.
    My recent post Proof that money cant buy style

Trackbacks/Pingbacks

  1. […] WordPress Guide: Howto Force Your Blog Load Fast […]

  2. […] know in one of my previous posts I have advocated to NOT use caching plugins but if you are on a shared hosting – you might not have a choice when put in front of simple […]

  3. […] WordPress Guide: Howto Force Your Blog Load Fast […]

  4. […] WordPress Guide: Howto Force Your Blog Load Fast […]

  5. Cacilda N.C. says:

    WordPressGuide Series:WordPress Guide – How to Force Your Blog to Load Fast http://bit.ly/1qHQQ8 RT @MartyVettel #WordPress