---
title: "Query Monitor"
description: "Query Monitor: diagnose a slow WordPress site, strengths, limits (db.php, memory), safe production settings and a patched XSS vulnerability."
language: "en"
locale: "en-US"
type: "plugin-sheet"
canonical: "https://www.wp-feint.com/features/camouflaged-plugins/query-monitor/"
published: "2026-11-04T08:00:00+00:00"
modified: "2026-11-22T12:41:12+00:00"
translations:
  en-US: "https://www.wp-feint.com/features/camouflaged-plugins/query-monitor/index.md"
  fr-FR: "https://www.wp-feint.com/fr/fonctionnalites/extensions-camouflees/query-monitor/index.md"
  es-ES: "https://www.wp-feint.com/es/funcionalidades/plugins-camuflados/query-monitor/index.md"
  de-DE: "https://www.wp-feint.com/de/funktionen/getarnte-plugins/query-monitor/index.md"
  it-IT: "https://www.wp-feint.com/it/funzionalita/plugin-camuffati/query-monitor/index.md"
  pt-BR: "https://www.wp-feint.com/pt/recursos/plugins-wordpress-camuflados/query-monitor/index.md"
  nl-NL: "https://www.wp-feint.com/nl/functies/gecamoufleerde-plugins/query-monitor/index.md"
---

# Query Monitor

Query Monitor, one of the most installed debugging tools for WordPress, shows the SQL queries, PHP errors, hooks and HTTP calls of every page, plugin by plugin. Our take on when to use it, its limits, safe settings on production and the patched vulnerability to know about.

## The essentials

- Best for pinning down the plugin or theme that slows a page down or throws PHP errors.
- Main caveat: one page at a time, no history, and panels built for developers.
- Free with no paid version, funded by sponsorships of its author.

## 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.

![Diagram: Query Monitor works on wordpress, database and files, external services. Public traces: folder name (hidden with Pro); tag IDs (hidden with Pro).](https://www.wp-feint.com/media/wpm-sheets/query-monitor/diagram-en.svg?v=d5811a74)

## 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_EXPENSIVE`**  `wp-config.php` | `0.05` (default), adjusted to your server | The threshold in seconds above which a query is flagged as slow. |
| **`QM_ENABLE_CAPS_PANEL`**  `wp-config.php` | `true` only when debugging permissions | The Capability Checks panel is off by default for performance reasons. |
| **`QM_DISABLE_ERROR_HANDLER`**  `wp-config.php` | `false` (default) | Set it to `true` only if the site already has its own PHP error handling. |
| **`QM_DISABLED`**  `wp-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.php` exists; if not, the [WP-CLI](https://www.wp-feint.com/glossary/wp-cli/) command `wp qm enable` puts 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.php` is 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.

## 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](https://www.wp-feint.com/features/camouflaged-plugins/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.

## Key facts

- Category: Backup and site management
- Vendor: John Blackbourn
- Price: Free, with no paid version
- Active installations (wordpress.org): 200 000+
- Version: 4.1.1
- Official page: https://wordpress.org/plugins/query-monitor/

## What WP Feint hides

- Handled by WP Feint Pro only
- With Pro: folder name, tag IDs
