WordPress show SQL queries

To show SQL queries you may add this code to your wp-config.php file:

define('SAVEQUERIES', true);

And add this code to active theme's footer.php file:

<?php
if (current_user_can('administrator')){
    global $wpdb;
    echo "[pre]";
    print_r($wpdb->queries);
    echo "[/pre]";
}
?>

Or you may use one of these plugins:

Leave a Reply

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