If you know a little PHP, yes.
Add this to your wp-config file:
define('SAVEQUERIES', true);
Then, somewhere in your template (probably at the end of the footer.php, add this code:
if (SAVEQUERIES) {
echo "<!--\n";
print_r($wpdb->queries);
echo "\n-->\n";
}
I think that will do it. Anyway, then look at the source of any page and all the queries it ran will be at the bottom.
Don’t leave this turned on, BTW. Turn it off again when you’re done looking at the output.
Alternative… and safer:
<?php
if ( SAVEQUERIES && current_user_can('manage_options') && $_GET['showqueries'] ) {
echo "<!--n";
print_r($wpdb->queries);
echo "n-->n";
}
?>
Then just access http://example.com/?showqueries=1 while logged in as an Administrator level account.
Sweet! Thanks to both of you! π