How to Optimize WordPress for Speed: Part 1

Posted by Nile | Posted in Tutorials | Posted on 05-09-2010 | 3 Comments

Tags: ,

This is a guest post by Jason Capshaw. Jason Capshaw is founder of MyWebTronics, an Atlanta web design firm. He resides in Atlanta with his wife and two children

There are many reasons why you want WordPress to be as fast as possible. The least of which is user experience. Visitors are extremely impatient with slow loading sites. Google has zero’d in on this fact and has now added site speed as one of its 200+ ranking factors.

Reduce data base requests

Use DB Cache to cache data base queries so that the server does not have to access the MySQL database. Database queries use up a significant portion of server resources. By only performing the database query once for multiple visitors, you free up resources to quickly download the page.

Once the plugin is activated, you will see the following at the bottom of your content if you have wp-footer() in your site:


Generated in 0.730 seconds. Made 23 queries to database and 9 cached queries. Memory used - 19.67MB
Cached by DB Cache

As you can see, it gives you a readout of how many queries were performed and how many were pulled from cache.

Optimizing your MySQL database

If you have ever used Steam for gaming, or defragged a computer hard drive, you are familiar with this concept. Basically, phpMyAdmin gives you the ability to repair corrupted data and optimize tables.

Open your phpMyAdmin panel and navigate to the database structure. Select all of the tables and select ‘Repair tables’.

Repeat the process and this time select ‘optimize’. Your MySQL database will be running at maximum capacity.

Tip: to keep from having to do this manually, you could just create a cron job and do something like this in a php file:


$sql = 'OPTIMIZE TABLE `wp_commentmeta`, `wp_comments`, `wp_links`, `wp_options`, `wp_postmeta`, `wp_posts`, `wp_terms`, `wp_term_relationships`, `wp_term_taxonomy`, `wp_usermeta`, `wp_users`';


mysql_query($sql);

Please stay tuned for Part 2 of How to Optimize WordPress for Speed.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • FriendFeed
  • Identi.ca
  • LinkedIn
  • Posterous
  • Reddit
  • StumbleUpon
  • Technorati
  • Tumblr
  • Twitter
  • Yahoo! Buzz

Related posts:

  1. How to Optimize WordPress for Speed: Part 2
  2. On Installing And Uninstalling Plugins
  3. WordPress Plugin Review: StatPress
  4. Two Ways to Retrieve Your WordPress Password
  5. Changing Your Username In WordPress

About Nile Flores

Web and graphic designer fom Southern Illinois. I love to work with WordPress.

Connect with Nile at: Twitter | Facebook | LinkedIn

Nile has written 92 articles at WPAddict.

Comments (3)

[...] This post was mentioned on Twitter by Rendy. Rendy said: How to Optimize WordPress for Speed: Part 1 http://bit.ly/cHmrus [...]

[...] This is Part 2 in the series of How to Optimize WordPress for Speed. [...]

How to Optimize WordPress for Speed: Part 1…

…s for Speed. Related posts: How to Optimize WordPress for Speed: Part 2; On Installing And Uninstalling Plugins; Two Ways to Retrieve Your WordPress Password….

Write a comment