QuestionsCategory: Technical QuestionHow do I display database query statistics on wordpress site?
asked 12 months ago
I’ve noticed that a few WordPress blogs have query statistics present in their footer that simply state the number of queries and the total time required to process them for the particular page. I was wondering how this is accomplished. Is it through the use of a particular WordPress plug-in or perhaps from using some particular PHP function in the page’s code?

1 Answers
tech Staff
answered 12 months ago
If you want to show it, you can try adding this to the bottom of the footer in your template:

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


Your Answer