Debug WordPress
January 12, 2026 ยท View on GitHub
Tools and techniques for debugging WordPress.
Incoming HTTP requests
Dump HTTP request headers to debug-request-headers.log.
Install this plugin.
Follow error log: tail -f wp-content/debug-request-headers.log
Dump POST request body to the error log.
Copy this snippet to wp-config.php.
Follow error log: tail -f error_log
Tools
- For permalinks:
rewrite-rules-inspectorplugin - For AJAX requests: https://github.com/szepeviktor/qm-ajax
- For REST requests: https://querymonitor.com/wordpress-debugging/rest-api-requests/
HTTP response headers
Open developer tools in your browser.
Tools
HTTP response body
View page source in your browser.
Important
Check Web Console for JavaScript errors.
Tools
PHP code
Dump triggered hooks (actions and filters) to a file.
Copy this MU plugin to wp-content/mu-plugins/.
Follow the log: tail -f wp-content/debug-hooks.log
Alternatively enable debugging in wp-config.
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
ini_set('display_errors', '0');
Follow the log: tail -f wp-content/debug.log
What is happening?
- Hooks: log in
allaction. - SQL queries: log at the end of
wpdb::_do_query()in wp-includes/class-wpdb.php - Object cache: log in
WP_Object_Cache::get()andWP_Object_Cache::set()in wp-content/object-cache.php
Tools
- Plugin Identifier Search https://plugintests.com/search-ids
PHP errors
Follow PHP error log: tail -f error_log
Outbound HTTP requests
Log requests and responses.
Tools
snitchpluginlog-http-requestsplugin
Cron events
Cron can be web-based and CLI-based.
Log events and failures.
Background queue jobs
Check Action Scheduler logs.
Database queries
Log queries before they are executed, see EXPLAIN statement.
Copy this snippet to wp-includes/class-wpdb.php.
Follow the log: tail -f wp-content/debug-queries.log
Log failed queries.
Tools
index-wp-mysql-for-speedplugin- Database Performance tuning
Emails
Log sent emails and sending failures.
Support my work
Please consider supporting my work as these lists take years to compile.
Thank you!
General debug tools
query-monitorplugin- Test Mode plugin
- Troubleshooting Mode of
health-checkplugin airplane-modepluginwhats-runningpluginfrontend-debuggerplugin- https://themecheck.info/