Troubleshooting
Query Monitor for debugging WordPress problems
Query Monitor is still useful for inspecting a specific request from WordPress. To analyse performance across several requests without leaving a diagnostic plugin active, you also have PHP X-Ray.
Query Monitor adds diagnostic panels to the admin bar. Among other things, it lets you review:
- SQL queries in the request.
- PHP errors raised during the inspected request.
- Calls made through the WordPress HTTP API.
- PHP environment, web server and effective configuration.
- Information about hooks, actions and enqueued scripts.
Enable it only during the test and only for trusted administrators: its panels can show paths, queries and internal data. Disable it when you have finished.
Procedure
- Note the URL, the action and the time of the problem.
- Enable Query Monitor and repeat that same action once.
- Open its menu in the top bar and check PHP Errors, HTTP API Calls and Queries first, depending on the symptom.
- For a slow or duplicated query, check Caller and Component. The number of queries or their duration alone does not prove which component caused the problem.
- Keep the smallest block you need, hide sensitive data and disable the plugin.
Queries by component groups the queries associated with each component during that request. Use it to form a hypothesis and repeat the same action on staging after a controlled change. If the result changes consistently, you will have evidence to update, replace or report the component.
What a single page load does not show
The panel describes the inspected request; it is not a history of every visitor or a monitor of every cron task. A response served entirely from cache may not run WordPress and therefore will not generate this data.
Query Monitor adds extra work to collect information. Compare the same operation under equivalent conditions and then confirm the improvement without the diagnostic plugin. For AJAX or REST requests, use the mechanisms supported by the installed version and always relate the result to the specific request; the bar from a previous page does not automatically describe a later save.
You may also find useful
- Debug errors in WordPress Find WordPress blank screens and internal failures by sending WP_DEBUG to a private log, without sho...
- 404 errors on static files slow down browsing Detect missing static resources that trigger PHP and use CPU, serve them as lightweight 404s and gui...
- Diagnose "Missed schedule" Check why a scheduled post was not published before replacing WP-Cron with a server task.
- Diagnose Sodium cryptographic errors in WordPress Tell a missing Sodium extension apart from an invalid argument in sodium_compat before changing the...
Something wrong or out of date? Tell us and we will review it.