Filed Under: Wordpress

Wordpress: Count SQL Queries

11 May 2008 No Comment Tags: , ,

For a developer loading speed is a crucial factor, therefore it is necessary to check how many SQL queries are needed to build a page.

To do that in Wordpress add this code anywhere in your template and it will show the queries that are needed until that specific part. If you want to know how many queries are needed for loading the full page then put the code in the footer.php

<? php echo get_num_queries(); ?>

You are able to use it several times inside your template, so insert it anywhere as many times as required.That’s great for locating potential “troublemakers”

Source:Playworkplay.com







Like our posts? Then subscribe via Mail:

Email:  

Similar Posts:

Socialize:

delicious stumbleupon

Leave your response!

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="">

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.com.