Get the number of queries processed in a WordPress Page

By | January 9, 2012

Login and Share to get Free Bitcoins

For every visitor from share you will earn Bitcoin/Satoshi

Sponsor Ads

stumble

Get the number of queries processed in a WordPress Page

Reducing the number of queries in WordPress page can help page’s to load faster.Here we like to share a small code which get the number of  queries  processed in a page.

sql WordPress

[code]
<!–?php echo get_num_queries(); ?–> [/code]

It get the number of queries processed in a WordPress page.

To get the time taken to process the queries

[code]
<!–?php timer_stop(1); ?–>[/code]

Add a stop timer after the the queries function.

Join both and function and add it into the footer of your WordPress theme template .

[code]<!–?php echo get_num_queries(); ?–> queries in <!–?php timer_stop(1); ?–> seconds.[/code]

E.g:

Check this page footer.

Leave a Reply

Your email address will not be published. Required fields are marked *

Human Verification: In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.