Troubleshooting · Guide
How to Read the WordPress debug.log File
Short answer
Turn on WP_DEBUG and WP_DEBUG_LOG in wp-config.php, then open wp-content/debug.log and read the newest entries from the bottom up. Each entry shows a timestamp, an error type, a message, and the file path with a line number. The folder named in the path, usually a plugin or theme, is where the problem sits.
Key takeaways
- The debug.log file lives at wp-content/debug.log and records PHP errors, warnings, and notices.
- WP_DEBUG_LOG only works when WP_DEBUG is true, and WP_DEBUG_DISPLAY set to false keeps errors off your pages.
- Log times are in UTC, so match entries to the UTC time of the failure.
- A path through wp-content/plugins or wp-content/themes names the plugin or theme behind the error.
- Delete debug.log to clear it, and set WP_DEBUG and WP_DEBUG_LOG back to false when you finish.
What is the WordPress debug.log file?
The debug.log file is a plain text record of PHP errors, warnings, and notices that WordPress writes into your wp-content folder.
WordPress creates this file only after you turn on debug logging. Each entry carries a date, a time, an error type, and the file and line number behind the problem.
That record is the fastest way to find why a page shows a blank screen or a fatal error. Instead of guessing which plugin broke, you read the file and it names the file for you.
How do you turn on debug logging?
Add three lines to wp-config.php just above the “stop editing” line.
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
The WordPress debugging handbook states that WP_DEBUG is false by default, so nothing is logged until you change it. WP_DEBUG_LOG only takes effect when WP_DEBUG is true, and WP_DEBUG_DISPLAY set to false keeps errors off your pages while the log still records them.
When WP_DEBUG is true, WordPress sets PHP error reporting to E_ALL, so every notice and warning is caught. That detail comes from the Learn WordPress lesson on built-in debugging options.
After you save wp-config.php, load any page on your site once. WordPress writes the log entries for that page load into the file right away.
If your site is live, do this work on a staging copy first when you can. The WordPress debugging handbook says debug tools are meant for local testing and staging installs, not live sites.
Where is the debug.log file stored?
The file lives at wp-content/debug.log inside your WordPress install, unless you set a custom path.
On most shared hosts the full path looks like public_html/wp-content/debug.log. Open your host file manager or FTP client, open the wp-content folder, and the file should be there after a page load with logging on.
You can send the log somewhere else by giving WP_DEBUG_LOG a file path instead of true. The WordPress debugging handbook shows this example: define( 'WP_DEBUG_LOG', '/tmp/wp-errors.log' );.
Some hosts keep their own PHP error log instead, so ask your host where it lives if debug.log never appears. If the error leaves you with a blank page, our white screen fix guide walks through the next steps.
How do you open and read the debug.log file?
Download the file with FTP or open it in your host file manager, then read it from the bottom up because the newest entries sit at the end.
Entries are plain text, so any text editor opens the file. On a server with SSH, run tail -n 100 wp-content/debug.log to see the last 100 lines, or tail -f wp-content/debug.log to watch new entries appear live.
Note the times in the log are in UTC, not your local time. WPBeginner's guide to WordPress error logs points this out, so match the entry time to the UTC time of the failure.
If the file is large, search for the word “Fatal” first. Fatal errors stop the page, so they are the ones that match a white screen or a critical error message.
What does a debug.log entry look like?
A typical entry starts with a date and time in brackets, then the error type, the message, and the file path with a line number.
[21-Nov-2026 02:15:10 UTC] PHP Fatal error: Uncaught Error: Call to undefined function my_broken_function() in /home/user/public_html/wp-content/plugins/example-plugin/example-plugin.php on line 42
Read it left to right: the timestamp tells you when it happened, “PHP Fatal error” tells you the page stopped, and the path tells you the plugin folder and the exact line. The entry above is a made-up sample that shows the shape of a real entry, not an error from a real site.
A stack trace may follow, listing the functions that ran before the error. Read the first few lines of the trace, since they name the plugin or theme files in the chain.
What do the error types in debug.log mean?
Each entry starts with a type that tells you how serious the problem is.
| Type | What it means | What to do first |
|---|---|---|
| PHP Fatal error | The page stopped running | Find the file named in the entry and fix or deactivate it |
| PHP Warning | Something went wrong but the page kept loading | Note the file and line, then check for an update or a bad setting |
| PHP Notice | A small coding slip, often an undefined variable | Log it for the developer; the page usually still works |
| PHP Deprecated | Code uses a function marked for removal | Plan an update; the feature still works for now |
| PHP Parse error | A syntax mistake in a PHP file | Fix the file or restore the last good copy |
Fatal errors and parse errors are the ones that break pages. Warnings and notices often pile up in the log without any visible symptom, so judge them by whether your site still works.
Deprecated notices name the old function and often name its replacement. The WordPress debugging handbook says these notices often point to the new function you should use instead.
How do you find which plugin or theme caused the error?
Look at the file path in the entry: a path through wp-content/plugins names the plugin, and a path through wp-content/themes names the theme.
For example, a path that includes /wp-content/plugins/contact-form-7/ points at Contact Form 7, while a path inside /wp-content/themes/twentytwentyfive/ points at the theme. The folder name right after plugins/ or themes/ is the culprit in most cases.
If the path sits inside wp-includes or wp-admin, the cause is usually a plugin or theme calling core code in a bad way. Search the log for the first entry that names a plugin or theme file, since later entries are often knock-on effects.
Once you know the name, open the plugin page on WordPress.org and check when it was last updated and which WordPress version it was tested up to. That check tells you whether an update is overdue or the plugin has been left behind.
If several plugins appear, fix the one tied to the earliest fatal error first. One broken plugin can trigger errors in others, so the first fatal error is usually the root cause.
If the culprit turns out to be a clash between two plugins rather than one bad plugin, our plugin conflict fix guide can help.
For a visual view of the same errors, install Query Monitor. The WordPress theme handbook debugging page lists Query Monitor among the debugging plugins, and says it shows database queries, PHP errors, hooks, and HTTP API calls.
How do you use debug.log to fix a white screen?
Reproduce the white screen once with logging on, then open debug.log and read the newest fatal error at the end of the file.
The entry names the file that failed. If it names a plugin, rename that plugin folder over FTP to deactivate it, then reload the site. Our white screen fix guide walks through that rename step in full.
If the entry names your theme, switch to a default theme such as Twenty Twenty-Five from the dashboard, or rename the theme folder over FTP if the dashboard will not load. The site should load again once the broken code stops running.
If no fatal error appears, check that WP_DEBUG and WP_DEBUG_LOG are both true and that the constants sit above the “stop editing” line. A common slip is placing them after that line, where WordPress never reads them.
How do you clear the debug.log file?
Delete the file over FTP or in your host file manager, and WordPress creates a fresh empty one on the next logged error.
The log grows with every notice and warning, so a busy site can build a large file fast. Clear it before you start a test so the entries you read belong to that test only.
Do not leave logging on for weeks on a live site. The WordPress debugging handbook warns that debug tools are meant for local and staging use, and a growing log can also expose file paths if anyone reaches it.
When the problem is fixed, set WP_DEBUG and WP_DEBUG_LOG back to false. WPBeginner's guide to WordPress error logs gives the same advice: change both lines back to false when you finish.
What mistakes should you avoid?
Never leave WP_DEBUG_DISPLAY set to true on a live site, since visitors then see raw error messages with file paths.
- Do not share the full log in a public forum post, since it lists server paths and plugin names.
- Do not edit wp-config.php below the “stop editing” line, since code there may never run.
- Do not chase every notice while a fatal error is still breaking pages; fix the fatal error first.
- Do not forget to turn logging off after the fix, or the file keeps growing.
SAVEQUERIES is a related constant that saves every database query for review, but it slows the site. The WordPress debugging handbook says it has a performance impact, so turn it off when you stop debugging.
Frequently asked questions
Why is there no debug.log file in my wp-content folder?
The file only appears after you turn on logging with WP_DEBUG and WP_DEBUG_LOG set to true in wp-config.php, and after a page load that produces an error. Check that both lines sit above the “stop editing” line in wp-config.php. If the file still never appears, ask your host where its PHP error log is kept.
Can I read debug.log from the WordPress dashboard?
WordPress core has no built-in log viewer, so you read the file over FTP, through your host file manager, or with SSH. Some hosts show PHP logs in their control panel. Free plugins such as Query Monitor or Debug Bar can also show PHP errors inside the admin bar once WP_DEBUG is on.
Is it safe to leave WP_DEBUG on all the time?
No. On a live site it can show error messages and file paths to visitors, and the log file keeps growing. Turn logging on only while you are fixing a problem, then set WP_DEBUG and WP_DEBUG_LOG back to false and delete the log file.
What should I do if debug.log shows only notices and no fatal error?
Notices rarely break pages, so the cause of a broken page may sit elsewhere, such as a JavaScript error, a server limit, or a caching fault. Fix the fatal error first if one appears, then check the browser console and your host error log for the rest.
Can I change where debug.log is stored?
Yes. Give WP_DEBUG_LOG a file path instead of true, for example a path under the tmp folder on your server. The log then goes to that file instead of wp-content/debug.log. Make sure the folder you pick is writable by the web server.
Sources
- Debugging in WordPress WordPress Developer Resources
- The built-in WordPress debugging options Learn WordPress
- Debugging WordPress Developer Resources
- How to Find and Access WordPress Error Logs WPBeginner
- A Complete Guide to WordPress Debugging Kinsta
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
