Welcome to my blog, please feel free to subscribe to my RSS feed, join me on Twitter or leave a comment.
WordPress is a great tool but for those of us on shared hosting it’s important that as our web traffic increases we look at ways to decrease the amount of stress our sites put on the web server. I found a couple of wonderful suggestions on Lorelle’s website and I’ve added a few of my own.
There’s a couple of reasons for this, first we want to make sure our web pages load as quickly as possible but as importantly we want to ensure our website stays online. There are countless stories on the internet about websites that suddenly found themselves very popular and struggled to keep up with the traffic, only to have their account temporarily shut down by the hosting company.
WordPress is written in PHP and uses a MySQL database to serve up content. This is great except the content on your website doesn’t change all that often so why are you dynamically generating it for each visitor? Instead of rebuilding the xHTML for each visit, why not serve them a previously saved version? We call this caching a website and it can be done with the wp-cache plugin from Ricardo Galli Granada.
So the first step to increased speed of your WordPress website is to download and install the WP-Cache plugin. It allows you to set how many seconds between page caching as well as if any specific files should never be cached. Very handy. You should also make sure you’re on a reliable web host who can handle the traffic.
Diggproof & Speed up Your Wordpress Blog has a great and often overlooked suggestion. Upgrade your WordPress blog. This might sound silly but generally speaking the latest code releases for WordPress are stable and optimized, so taking a little bit of time to upgrade your site during each release is a solid idea.
Unused plugins can kill performance so before you go installing and forgetting about your plugins, make a habit of deleting unused plugins. Some people might assume deactivating them is good enough but personally I prefer to delete them.
Using a tool such as phpMyAdmin take time once a week to optimize your MySQL tables. If you don’t have access to phpMyAdmin, execute the following SQL statement from your command line to make sure your tables are in the best shape possible:
OPTIMIZE TABLE `wp_comments`, `wp_links` , `wp_options` , `wp_postmeta` , `wp_posts` , `wp_ratings` , `wp_terms` , `wp_term_relationships` , `wp_term_taxonomy` , `wp_usermeta` , `wp_users` , `wp_wpsb_users`
Arne has some great suggestions for MySQL Query Cache and PHP Compiler Cache options, they’re pretty technical but well worth it if your running into significant server speed issues. If you’re technical, give this article on how to configure Apache a read as well, it will help you optimize your whole site.
Paul Stamatiou makes a great point by writing “Every HTTP request, or loading each item on your website, has an average round-trip latency of 0.2 seconds. So if your site is loading 20 items, regardless of whether they are stylesheets, images or scripts, that equates to 4 seconds in latency alone“. So, take a good long look at your theme and determine what you really need in there. I saved a ton of time per page load by stripping out over 20 JavaScript calls and replacing them with PHP scripts which are cached once every five minutes. I also combined all my CSS files into a single file which decreased the number of HTTP requests my server had to take. Paul also have a great article on Compressing CSS with PHP that you should read if you still need to speed up your site more.
There’s another great suggestion from WPCandy that I’m extremely reluctant to do, but I know they’re right. First, use shorthand CSS so:
#commentarea li {
margin-top: 10px;
margin-bottom: 10px;
}
should become:
#commentarea li {
margin: 10px 0px 10px 0px;
}
You should also decrease whitespace (that’s the empty space between tags), sure it makes it look better but it also takes up bandwidth.
Finally, decrease your overall database calls. WordPress gives us all sorts of great functions in our templates but really do you need to call the website name from your database? The simple answer is no, so let’s decrease the over all number of MySQL queries by optimizing our templates. Replacing with your title for example will help decrease the server load.
I hope this helps, if you have any other suggestions for how to optimize WordPress and speed up the site please let me know.






Work At Home Ideas on October 22, 2008 at 11:35 am
Hi Chris,
Good tips you have here and I especially like the WP-Cache plugin which I’m going to install. Thanks for sharing.
Peter Lee
Afe on January 03, 2009 at 12:10 pm
great article! I like it.
Money Academy on January 21, 2009 at 12:38 pm
i will check WP-Cache plugin ,which you offer in first step .
my blog have much images so this maybe make extra load or make my blog load become slower .
Money Academy’s last blog post..Feedburner problem while posting my feed url
Christopher Ross on January 21, 2009 at 12:49 pm
I took a quick look at the Money Academy and I think you’ll find the WP-Cache will help you quite a bit. You should also take a look at lowering the number of external calls on your page. Currently you have 35 images and >20 JavaScript’s being loaded on your homepage. If it’s at all possible, I would look at minimizing those. Chris
Josh K on January 23, 2009 at 1:31 am
You rock. World needs more souls like you.
Mohammed Shokry on April 26, 2009 at 2:09 pm
@Chris , i’m happy that you visiting my blog it is my honor , i discover that i have really much images do you advice me to change this theme or remove some mini-posts from homepage ?
Mohammed Shokry’s last blog post..Applying for a new job ? need a CV ? so learn how to write or build a prefect and effective cv