How Do I Debug WordPress?
When something goes wrong on a WordPress site, it is tempting to start guessing.
Maybe the problem is a plugin. Maybe it’s the theme, or the latest update broke something. Sometimes one of these guesses will be right, but guessing is a slow and unreliable way to troubleshoot.
Debugging gives you a better path.
What Debugging WordPress Means
Debugging WordPress means collecting enough information to understand the cause of the problem.
This may involve checking PHP errors, reviewing WordPress debug logs, inspecting database queries, or several other actions.
A good debugging process usually answers questions like:
- What action triggers the issue?
- Is WordPress recording an error?
- Which plugin, theme, file, or query is involved?
- Did the problem begin after a recent update or configuration change?
- Can the issue be reproduced consistently?
Once you have the answers to these questions, troubleshooting becomes much easier.
Start by Reproducing the Problem
Before changing settings or disabling plugins, try to reproduce the issue.
This means repeating the same action that caused the problem in the first place. For example, you might reload the broken page, rerun the failed import, or repeat the same admin action.
This matters because debugging works best when you can connect a specific action to a specific result. If the problem only happened once and you cannot reproduce it, the available information may be limited.
When testing, write down the basic details:
- What page or screen were you on?
- What action did you take?
- What happened afterward?
- Did the issue affect the front end, admin area, or both?
- Did it happen for all users or only certain users?
This gives you a clearer starting point when you begin looking at logs or changing site settings.
Turn On WordPress Debugging
WordPress includes built-in debugging features, but they are usually disabled by default.
To enable them manually, open your site’s wp-config.php file and place the following code above the line that says /* That's all, stop editing! Happy publishing. */:
define( ‘WP_DEBUG’, true );
define( ‘WP_DEBUG_LOG’, true );
define( ‘WP_DEBUG_DISPLAY’, false );
This tells WordPress to collect debugging information, write errors to a log file, and avoid showing raw error messages publicly on your site.
The most important setting for most troubleshooting work is WP_DEBUG_LOG, because it creates a record you can review after the problem occurs.
Check the WordPress Debug Log
After debugging is enabled, reproduce the issue again, then check the WordPress debug log.
In a typical WordPress installation, the log is located here:
/wp-content/debug.log
Open that file and look for errors that appeared around the time you reproduced the issue.
A useful error message often includes a file path, line number, plugin or theme folder, or a function name. Those details can help you understand the source of the problem.
For example, an error path that includes /wp-content/plugins/example-plugin/ points you toward that plugin.
Do not assume every warning in the log is the cause of the problem. Focus on recent entries, fatal errors, repeated messages, and anything that lines up with the action you tested.
Isolate Plugins and Themes Carefully
Many WordPress issues are caused by plugin conflicts, theme code, or compatibility problems after an update.
If the error log points to a specific plugin or theme, start there. If the log does not clearly identify the cause, you may need to isolate the issue manually.
A common approach is to test whether the issue still happens when certain plugins are disabled or when a default theme is active. On a live site, do this carefully. If possible, use a staging copy so you do not disrupt visitors or customers.
When testing plugins, avoid changing everything at once. Disable one likely suspect, test the issue again, and then record what happened. If you disable many plugins at the same time, you may make the issue disappear without knowing which plugin caused it.
The same principle applies to themes. Switching themes can tell you whether the active theme is involved, but it can also change layouts, templates, and functionality. Use staging whenever possible.
Look Beyond Fatal Errors
Not every WordPress problem produces a clear fatal error.
Some issues are caused by slow database queries, broken AJAX requests, or code that technically runs but behaves incorrectly.
For example, a page might load slowly because a plugin is running too many queries. An admin screen might lag because the same query is run repeatedly. A process might fail because it times out before completion.
In these cases, the debug log may not tell the whole story. You may also need to inspect server logs, browser console errors, or plugin-specific logs.
The right tool depends on the symptom. A white screen suggests PHP errors. A slow page points you toward performance and database queries. A button that does nothing may require checking JavaScript or AJAX requests.
Use WP Debug Toolkit for a Faster Workflow
Manual debugging works, but it can be tedious.
You may need to edit wp-config.php, reproduce the issue, open debug.log, refresh or download the file, search through entries, and then remember to turn debugging off afterward.
WP Debug Toolkit gives you a more convenient way to handle this workflow from the WordPress admin area:

It can help you:
- Enable and disable debugging without manually editing
wp-config.php - View errors, warnings, and notices in the dashboard
- Connect errors to the action that triggered them
- Identify affected plugins, themes, files, and line numbers more quickly
- Review debugging information without digging through server files
This is especially useful if you troubleshoot WordPress sites often or need a cleaner way to see what is happening while you reproduce an issue. For example, looking at an organized interface like this is a lot better than manually wading through a log file:

WP Debug Toolkit also gives you advanced tools to monitor and analyze database queries:

Additionally, it allows you to monitor your site 24/7, and has a special crash recovery system that allows you to disable and re-enable plugins and themes even when you don’t have access to wp-admin.
Final Thoughts
How do you debug WordPress?
Start by reproducing the issue so you know exactly what you are testing. Then enable debugging, check the error log, and look for messages that point to a plugin, theme, file, line number, or other specific cause.
If the logs do not explain the problem, isolate likely plugins and themes, check for performance issues, and look at related tools such as server logs, query viewers, browser console output, or plugin-specific logs.
The main rule is simple: do not debug blindly. Gather evidence first, then make targeted changes based on what the evidence shows.
To do all of this more efficiently, we recommend using WP Debug Toolkit, which lets you perform the entire debugging process from within the WordPress dashboard.
For other debug plugins, see Best Plugins for WordPress Debugging and Troubleshooting.



