What Query Monitor does on your site
Query Monitor is a developer tools panel for WordPress and WooCommerce. Once activated, it adds a menu to the admin toolbar that sums up the current page: generation time, peak memory, total query time and the number of SQL queries. One click opens detailed panels: database queries (slow, duplicate or failing), PHP errors with their call stack, hooks and actions, the template and template parts loaded, blocks, scripts and styles, translation files, HTTP API calls, updated transients and the environment (PHP, database, web server).
Its real strength is that it ties everything to a component: a plugin, the theme or WordPress core. The "Queries by Component" panel shows which plugin runs the most queries, or the slowest ones. Query Monitor also tracks Ajax requests and authenticated REST API requests (with a summary in the response’s HTTP headers), and adds the call stack to an HTTP header on every redirect. Since version 4 (April 2026), a "Timeline" view plots queries, HTTP calls, errors and logs on a single time axis, and the panels are rendered in the browser instead of by PHP.
To record full detail for every query (result count, complete call stack, errors), the plugin creates a symlink at wp-content/db.php on activation, a special WordPress file known as a drop-in. Query Monitor is built by John Blackbourn. It is completely free, with no paid version, and its development is funded by sponsorships. According to its privacy statement, it does not keep the data it collects and sends nothing to third parties.
When Query Monitor saves you time
Query Monitor shows what happens while a page loads, which matters most when something is wrong:
- A site that has become slow: the timeline, queries by component and HTTP API calls show where the time goes, including calls to outside services that a plugin makes on every page.
- Building a plugin or theme: PHP errors, "Doing it Wrong" notices and deprecated functions, the template actually used, hooks that fired, and the value of conditional functions such as
is_single(). - A WooCommerce store or a block theme: blocks and their attributes, template parts loaded or skipped, rewrite rules and query vars.
- Deciding on an object cache: the overview flags when no persistent object cache is active, which points you toward Redis or Memcached.
It is not a monitoring tool: it only shows the page you are loading right now, with no history, and it fixes nothing on its own. If nobody on the team can read an SQL query or a call stack, it will mostly help you hand precise information to a developer.
Query Monitor strengths and limitations
Strengths
- Everything is tied to a component. Queries, errors and HTTP calls are attributed to the plugin or theme responsible, so the culprit stands out fast.
- Very broad coverage. Pages, Ajax, the REST API, redirects, blocks, translations and multisite are all covered by one plugin.
- Private by default. The panel only shows up for administrators (Super Admins on multisite), and nothing is stored or sent elsewhere.
- Free and actively maintained. No paid features, regular updates, and Debug Bar add-ons appear in its menu.
Limitations
- One page at a time. The data covers the current page load; history is announced for a future version.
- Memory-hungry on heavy pages. The author admits that with hundreds of queries, it uses more memory than he would like.
- Possible db.php conflict. W3 Total Cache, LudicrousDB, HyperDB and SQLite Database Integration use the same file, which reduces query detail.
- Built for developers. The panels assume you can read SQL, hooks and call stacks.
The Query Monitor settings we recommend
Query Monitor has no page in the admin menu. Its settings live in its own panel (the cog icon next to the close button); the rest are PHP constants in wp-config.php.
| Setting | Recommended value | Why |
|---|---|---|
| Plugin activation Plugins > Installed Plugins | Only while you diagnose on production; always on in local or staging | Less memory used on heavy pages, and one less admin tool exposed all the time. |
| Set authentication cookie Toolbar > Query Monitor > Settings > Authentication | Only for a test, then "Clear authentication cookie" | This cookie lasts two days and shows Query Monitor when you are logged out or logged in as another user. |
| Editor Same screen, Editor section | Your code editor, on a local site | Call stacks become clickable and open the file; on a remote server you also need a path mapping. |
QM_DB_EXPENSIVEwp-config.php | 0.05 (default), adjusted to your server | The threshold in seconds above which a query is flagged as slow. |
QM_ENABLE_CAPS_PANELwp-config.php | true only when debugging permissions | The Capability Checks panel is off by default for performance reasons. |
QM_DISABLE_ERROR_HANDLERwp-config.php | false (default) | Set it to true only if the site already has its own PHP error handling. |
QM_DISABLEDwp-config.php | true on an environment where the plugin stays installed but unused | Turns Query Monitor off entirely, for example when it ships with the site’s code. |
- After activation, check that
wp-content/db.phpexists; if not, the WP-CLI commandwp qm enableputs it in place. - Open a slow page, then the "Timeline" and "Queries by Component" panels: the most expensive plugin shows up first.
- Open the site in a private browsing window: the Query Monitor menu must not appear.
- Once you are done, deactivate the plugin and check that
wp-content/db.phpis gone (this is automatic on a single site when the file belongs to Query Monitor).
The most comfortable setup is to keep Query Monitor installed on a copy of the site: our WordPress staging guide explains how to set one up.
Query Monitor security: an admin tool to keep updated
Query Monitor displays sensitive information (SQL queries, file paths, server environment), which is why it is limited to administrators. The most notable published vulnerability is CVE-2026-4267: a reflected XSS through the request address (REQUEST_URI) in all versions up to and including 3.20.3, fixed in 3.20.4. An attacker without an account could run a script if a logged-in user clicked a booby-trapped link (CVSS 7.2 according to Wordfence). Since the affected panel only appears to authorized users, in practice the target had to be an administrator (see our article on XSS vulnerabilities in WordPress).
Good habits: turn on automatic plugin updates for Query Monitor, and deactivate it on production when you are not using it. Its files live in /wp-content/plugins/query-monitor/: WP Feint Pro replaces that address and the ID of its assets wherever they appear, which makes it harder for bots hunting its vulnerabilities to spot, without replacing the update.
What WP Feint hides for Query Monitor
Pro Handled by WP Feint Pro only
The free version does not know the traces specific to Query Monitor: without Pro, only generator tags are removed, as for any plugin.
Free version
Handled by WP Feint Pro only
With Pro
- folder name
- tag IDs
Still visible
No known trace
Query Monitor FAQ
Does Query Monitor slow down my site?
A little, according to its author: the effect on generation time is small, but memory use grows on pages that run hundreds of queries. For a long operation (backup, import, security scan), a developer can call do_action( 'qm/cease' ) so that Query Monitor stops collecting.
Can visitors see the Query Monitor panel?
No. By default it only appears to administrators, or to Super Admins on multisite. Another account only sees it if you grant it the view_query_monitor capability or if the authentication cookie is set in its browser.
Why are the SQL query details missing?
The wp-content/db.php symlink could not be created: the folder is not writable, another db.php file is already there (for example the one from W3 Total Cache), the link broke during a migration, or the DISALLOW_FILE_MODS constant is on. Query Monitor still works with less detail; wp qm enable lets you try again.
Is there a paid version of Query Monitor?
No. The plugin is completely free; its author funds his time through sponsorships from companies and individuals on GitHub Sponsors.