wp-config.php içine aşağıdaki kodu ekleyin
define( 'SAVEQUERIES', true );
Sonrada temanızda sorguları görmek istediğiniz yere yazın
<?php
if ( current_user_can( 'administrator' ) ) {
    global $wpdb;
    echo "<pre>";
    print_r( $wpdb->queries );
    echo "</pre>";
}
?>