Simple Tricks to Speed Up Your WordPress Website.

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

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.

Post Tags
Tags are used throughout a website to link similar content, click any of the keyword tags below to find similar content here on my website. , , , , , , , , , , , , , , , ,

Technorati Tags
Technorati is a great way to find similar content, click the tags below to find other blogs on the web with similar content. amp, granada, habit, hosting company, little bit, mysql database, ricardo galli, seo, stress, suggestion, web host, web pages, web server, web traffic increases, wordpress, wordpress blog, xhtml,

About the author
Christopher Ross - Christopher Ross is a technology evangelist living in Fredericton, Canada who travels the world preaching the benefits of technology to business professionals. When he's not writing or blogging about the future of the industry, he's busy building websites or helping businesses market themselves on the Internet.

12 Responses to “Simple Tricks to Speed Up Your WordPress Website.”

Comments

You're welcome to leave a comment using the form below.

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

  2. Afe on January 03, 2009 at 12:10 pm

    great article! I like it.

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

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

  5. Josh K on January 23, 2009 at 1:31 am

    You rock. World needs more souls like you.

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

Pingbacks

Here's a list of web sites linking to this article. Would you like to be listed here? Link to my articles in your next post.

  1. How to rotate your logo on holidays. :: Christopher Ross on October 20, 2008 at 4:50 pm
  2. Using WordPress with LinkedIn and developing custom themes. :: Christopher Ross on October 29, 2008 at 10:00 am
  3. Add a Digg button to your WordPress web site :: Christopher Ross on December 13, 2008 at 1:47 pm
  4. Automatically Title Casing Tiles in WordPress :: Christopher Ross on January 05, 2009 at 12:24 pm
  5. 10 Ways to Protect WordPress from Hackers :: Christopher Ross on January 28, 2009 at 10:50 am
  6. SEO Costa Rica » Blog Archive » 10 Ways to Protect WordPress from Hackers on February 01, 2009 at 7:50 am

Leave a Reply

Please note: I've recently introduced a new policy on my website and welcome comments, including dofollow rules but I require all posters to use their real names (not keywords). Your comments are always welcome, keyword spam will be deleted immediately.

CommentLuv Enabled

Sponsors