WordPress – Add DB Queries and Loading Time to Footer



Once you know the code, it’s pretty simple to implement.  Without the code, good luck!

Open up your WordPress admin and navigate to Appearance > Editor.  Click on Footer on the right side.  Find the bottom of your footer, near your copyright.

Put this code in wherever you want it.

<?php echo $wpdb->num_queries; ?> queries. <?php timer_stop(1); ?> seconds.

There you have it. You can add something like this if you want to:

This page called the database <?php echo $wpdb->num_queries; ?> times and was loaded in <?php timer_stop(1); ?> seconds.

Post a comment if you have problems.

    

1 comment so far »

  1. Alexander Dombroff said

    January 31 2009 @ 10:15 am

    Just found this through a google search. Thanks a lot I’ve been trying to write the code for 30 minutes!

Comment RSS · TrackBack URI

Leave a comment

Name: (required)

eMail: (required)

Website:

Comment: