Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

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

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

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.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

7 CommentsLeave a Reply

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Aidan says

    You should make clear that the timer_stop() function only measures page load time, not how long the queries take to complete.
    These are often related, but the way you present the code makes it look like the queries are always related to the speed issues, and often they aren’t.

  3. 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.

      Admin

Leave a Reply to Aidan Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WPBeginner Assistant
How can I help you?

By chatting, you consent to this chat being stored according to our privacy policy and your email will be added to receive weekly WordPress tutorials from WPBeginner.