WordPress blogs are on average pretty slow loading. Fortunately there are a number of ways of speeding up a WordPress blog. Today I would like to take a look at a quick and simple way that could make a big difference.

If you open up your header.php file you will find markup similar to that illustrated in the graphic above. All the markup with the red bits (on this graphic) are PHP code to get various bits of information from the database.
One of these PHP calls is the following:
<?php bloginfo(’stylesheet_url‘); ?>
This is a PHP call to the database to find out in which directory the stylesheet is located in. Every blog is different but there are quite a few of these database calls in the Head section of the header.php file. I have just used the stylesheet directory as an example.
Every time a page is opened in WordPress the header.php file is called. Everytime this happens all the mentioned calls to the database are made to get the required information. This is normally coded this way so that the relevant theme can be used across multiple blogs without having to change the markup.
If you replace these database calls with the actual information required, WordPress will not have to call the database to obtain the necessary information for each of these instances.
If you right-click the main page on your blog and read the code of your page you will see that the real directory to the stylesheet directory is something like:
href="http://nice2all.com/wp-content/themes/nice2all/style.css">http://nice2all.com/wp-content/themes/nice2all/style.css
The code will show all the actual information in place of the PHP code contained in the original file. If you replace all these calls to the database with the relevant actual information you will save yourself a lot of unnecessary overhead. The effect on the speed of the pages will be quite substantial.
In your footer.php file you will most likely find similar database calls that could be replaced with the actual information.
The index.php file also has many of these but here I will stay away if you do not really know PHP. Many of the calls in this file are necessary and cannot be replaced.
Why not take a few minutes and turbo-charge you WordPress blog?











Thank you for this great information , I was looking for some ways to speed things up
Pleasure. There are quite a few ways of speeding up WordPress that I will still get to. In the mean time maybe you could do some Googling. Depending on what you have on your site, WordPress often does need quite a bit of speeding up.
Great post. Working with n-tier environments on a daily basis this is very obvious to me, but for some reason I had never thought about it in wordpress before. It is such a fundamental saving on the processing required to display the page I am kicking myself for not thinking of it before.
Kudos for a great post!
Jim
Jim Seftons last blog post..Thermometer goals chart – FREE
Thanks for the nice comment Jim, I am glad it helped. Thanks a ton for the Stumble.
No probs… by the way, I noticed the no nofollow in the first instance by the logo appearing in the comments box. Is that soething you developed yourself or is there a plugin for it?
Keep up the good work!
Jim
Jim Seftons last blog post..Wordpress 2.6 is out
Jim, I simply added the logo to the background of the textarea in the CSS. As soon as the box gets the focus it automatically disappears. Thanks for coming by.
Excellent, thanks. I have implemented it on my site and posted about it. I used the same graphic as you, is that ok? I wasn’t sure if it was one of your own or one produced for “the cause”. If you prefer I am happy to design my own, I just thought yours looks great.
Jim Seftons last blog post..You Comment, I Follow (what does it mean?)
Jim, the logo was designed by BioTecK. I use it with kind permission from these guys. Pay them a visit, I am sure they will not mind at all.
Nice info, Sailor.
I will try to apply this patch to my wp blog. I hope it will speed up a bit.
Thanks.