Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

How To Show Number of Queries and Page Load Time in WordPress

Last updated on by
Elegant Themes
How To Show Number of Queries and Page Load Time in WordPress

One of our users asked how do other sites show number of queries and page load time in the footer. You will often see this in the footer of sites and it may say something like: “64 queries in 1.248 seconds”. In this article, we will show you how to show number of queries and page load time in WordPress.

Simply paste the following code anywhere you like in your theme files (such as footer.php).

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

And refresh the page. You will see the number of queries and the execution time.


Editorial Staff at WPBeginner is a team of WordPress lovers led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »

Comments

  1. Sean Donovan says:

    It would be useful to know what a typical number of queries are for a WordPress site running 10 or so plugins…

    • Editorial Staff says:

      Can’t say at all because each plugin varies. You can use 10 plugins that work entirely in the backend which will add no queries on the front-end load. Or 10 really horrible coded plugins that can add tons of queries on the front-end.

  2. Thoriq says:

    It’s so simple, thanks for sharing this tip.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.