How to display database query statistics on WordPress site?

How to display database query statistics on WordPress site?

Finding out database query statistics is really very important for fast website loading. Sites having lots of database queries make the site slower and perform poor. By database query statistics, you can easily find out total number of queries on a WordPress page/post is called. You can also findslower queries that are  degrading the performance of your WordPress website. There are many ways to display database query statistics on WordPress site.

You can add following code to the bottom of the footer page:

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

Another code that can be used is:

<?php echo get_num_queries(); _e(' queries'); ?> in <?php timer_stop(1); _e(' seconds'); ?></p>

 

Related Post

  •  
  •  
  •  
  •  
  •  
  •  

Leave a Reply

avatar
  Subscribe  
Notify of