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.
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:
<!– <?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 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:
- Using FeedBurner PRO Stats? Give Your Blog HUGE Speed Boost! In this post I discuss how you can speed up your blog IF you are using FeedBurner stats package.
- 2 Things I Hate About WordPress And How To Turn Them Into Your Advantage is a post where I discuss how to use WordPress database maintenance to greatly increase loading speed of your blog.
- Howto Design WordPress Blog To Survive The Digg is a post that discuss how t deal with extra traffic to your blog.
- 13 Tags to Delete From your Theme is a great post by Pro Blog Design that discusses how to replace tags in your theme with their static definitions to improve load time.
- The 3 Easiest Ways to Speed Up WordPress post on Lorelle Von Fossen blog is a great tutorial that expands on many concepts of optimization and makes it simple for ya 🙂
- Howto Move WordPress To New Host – if you actaully have decided that this is an option for you, use my guide and move your blog safely to a new host without any downtime.
Tags: howto, howto-guides, WordPress, wordpress guide, wordpress-plugins