Title: SQL query surveillance
Last modified: August 21, 2016

---

# SQL query surveillance

 *  [Mads Phikamphon](https://wordpress.org/support/users/madsphi/)
 * (@madsphi)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/sql-query-surveillance/)
 * Hi,
 * I need to check how WP/Woocommerce queries the database, so we can make an administrative
   tool for our shop.
 * So is there a way to view/log how WP/Woocommerce queries the database?
 * For example a debugging plugin or a “secret” WP setting.
 * Thanks,
    Mads

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/sql-query-surveillance/#post-4488079)
 * Try the ‘query’ filter. This is part of the global `$wpdb` object which all WP
   developers are expected to use. If Woo does not use it and makes it’s own mySQL
   calls, this filter will not capture it.
 * I believe all the various query methods provided by the wpdb class eventually
   go through this filter, but I can;t be absolutely sure. You’ll probably want 
   to just write each query string to a log file for later analysis.

Viewing 1 replies (of 1 total)

The topic ‘SQL query surveillance’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [queries](https://wordpress.org/support/topic-tag/queries/)
 * [sql](https://wordpress.org/support/topic-tag/sql/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/sql-query-surveillance/#post-4488079)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
