WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/get num queries

Description

Retrieve the number of database queries during the WordPress execution.

Usage

<?php echo get_num_queries();?>

Parameters

None.

Return Values

(integer) 
Number of database queries

Examples

Notes

  • Uses global: (object) $wpdb

Change Log

Since: 2.0.0

Source File

get_num_queries() is located in wp-includes/functions.php.

Related

See also index of Function Reference and index of Template Tags.