How to Show Number of Queries and Page Load Time in Your WordPress Blog

You must have seen some of the website sharing their page load time and number of queries in the footer or anywhere on the website. It displays something like “51 Queries in 1.432 Seconds”. One of my friend asked me that how do they show that particular thing. In this article, I would be sharing a small code that you need to add in your theme files like footer.php.

So, here is the code that you need to add in any of your theme file depending on your decision that where do you want to show this particular information on your website. Foe eg: If you want to share this information in the footer, then you need to add this code in the footer.php

[Image Credit: Flickr]

<?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?> seconds.

 

Save the file and just refresh your blog/website and it will be displayed in the footer.

 

Follow us Via Facebook OR Twitter


If you enjoyed this article, get email updates (it's free).

2 Responses to “How to Show Number of Queries and Page Load Time in Your WordPress Blog”

  1. Awesome tutorial Harneet , look what i did with footer using this php.

    Reply to this comment

Leave a Reply


PREVIOUS POST :

NEXT POST :