Troubleshooting
WordPress No Error Log: Causes and How to Fix It

Short answer
WordPress does not create an error log by default. The debug log only appears after you set WP_DEBUG and WP_DEBUG_LOG to true above the stop editing line in the config file and an error actually happens. If it still stays empty, check permissions, custom log paths and your server PHP error log.
Key takeaways
- WordPress writes no error log until WP_DEBUG and WP_DEBUG_LOG are enabled.
- Constants must sit above the stop editing comment and must not be defined twice.
- An unwritable wp-content folder stops the log being created.
- WP_DEBUG_LOG can point to a custom path, so check its value.
- Early fatal and server errors appear only in the server PHP log.
- Turn debugging off and delete the log once you have finished.
Why is there no error log in WordPress?
WordPress does not create an error log by default, so debug.log only appears after you turn on WP_DEBUG and WP_DEBUG_LOG in wp-config.php and an error actually happens.
Many people go looking for wp-content/debug.log and find nothing. That is normal on a fresh or healthy site. WordPress writes the file only when three things are true:
WP_DEBUGis set totrue.WP_DEBUG_LOGis set totrueor to a file path.- PHP raises a notice, warning or error after those settings load.
If any of these is missing, there is no file. The rest of this guide covers the settings, the file permission problems, and the cases where errors go to a different log entirely.
| Cause | How to spot it | Fix |
|---|---|---|
| Debug logging is off | No WP_DEBUG lines in wp-config.php | Add WP_DEBUG and WP_DEBUG_LOG |
| Constants added below the stop editing line | Settings look right but do nothing | Move them above that comment |
| Constant defined twice | One copy set to false | Remove the duplicate |
| wp-content not writable | Errors happen but no file appears | Fix folder permissions |
| Custom log path | File is somewhere else | Check the WP_DEBUG_LOG value |
| Fatal error before WordPress loads | Blank page, empty log | Check the server PHP error log |
| No errors are happening | Site works normally | Nothing to fix |
How do I turn on the WordPress error log?
Add WP_DEBUG, WP_DEBUG_LOG and WP_DEBUG_DISPLAY to wp-config.php above the That's all, stop editing comment, then reload a page to trigger logging.
Open wp-config.php in the WordPress root. If you cannot find it, see where to find wp-config.php. Then add:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
WP_DEBUG_DISPLAY set to false keeps errors off the screen, which matters on a live site. Visitors should never see file paths.
The official Debugging in WordPress page explains each constant. Our step-by-step guide on how to enable debug mode in WordPress covers the same steps with screenshots of where the file sits.
Why does debug.log still not appear after enabling it?
If the settings are in place but no file appears, the constants are usually placed too late, defined twice, overridden by the host, or there are simply no errors to log yet.
Check each of these:
- Placement. Constants below
require_once ABSPATH . 'wp-settings.php';load too late. Move them above the stop editing comment. - Duplicates. Search the file for
WP_DEBUG. Many installs already containdefine( 'WP_DEBUG', false );. A second define is ignored and causes a warning, so edit the existing line instead. - Typos.
truemust not be in quotes.'true'works by accident, but'false'also counts as true, which confuses people later. - Managed hosting overrides. Some managed hosts control debug settings from their dashboard. Check your host's tools before editing the file.
- No errors yet. Visit the page that fails, or the admin area, to give WordPress something to log.
A quick test: add error_log( 'debug test' ); to a code snippet temporarily, load the site, and check for the file. If the line appears, logging works and your site just had no errors.
Could file permissions stop WordPress writing the log?
Yes, if the web server user cannot write to wp-content, PHP fails quietly and no debug.log is created even though errors are happening.
Typical WordPress permissions are 755 for folders and 644 for files. The file permissions page on WordPress.org covers the details.
Problems appear when:
- Files were uploaded by FTP as a different user than the web server.
- A security plugin locked
wp-contentto read only. - The site was restored from a backup with wrong ownership.
You can create an empty debug.log file in wp-content yourself and set it to 644 or 664. If WordPress then writes to it, permissions were the issue. On a VPS, make sure the PHP-FPM user owns the file.
If you see related symptoms elsewhere, such as failed updates, check how to fix unable to write to wp-config.php, which covers the same ownership problem.
Is the log being written somewhere else?
Errors may be going to a custom path set in WP_DEBUG_LOG, to the server's PHP error log, or to a log file your host keeps outside the WordPress folder.
Since WordPress 5.1, WP_DEBUG_LOG can hold a file path instead of true:
define( 'WP_DEBUG_LOG', '/home/user/logs/wp-errors.log' );
If someone set this before, the log lives at that path. Check the value in wp-config.php before assuming nothing is logged. Keeping logs outside the public web root is good practice, since anyone could otherwise open debug.log in a browser.
PHP also has its own error_log setting. Many hosts write PHP errors to a file named error_log in the folder where the error happened, or to a central log in the control panel. Our guide on how to check PHP error logs shows common locations.
The PHP manual's page on the error_log ini setting explains how the server decides where errors go.
Why is the log empty when the site shows a fatal error?
A fatal error that happens before WordPress reads wp-config.php, or a server-level failure such as a 500 error from bad .htaccess rules, never reaches the WordPress debug log.
Examples that bypass debug.log:
- Syntax errors in wp-config.php itself. WordPress cannot load its own debug settings.
- Broken .htaccess rules. Apache fails before PHP runs. Look in the web server error log, described in the Apache log files documentation.
- PHP-FPM crashes or timeouts. These show as 502 or 504 errors and appear in Nginx or PHP-FPM logs.
- Memory exhaustion very early in loading. Sometimes logged only by the server.
For server errors, the guide to the 500 internal server error walks through each layer. Your host's support team can also read logs you do not have access to.
How do I view and use the log once it exists?
Open wp-content/debug.log through FTP, your host's file manager or a log viewer plugin, read the newest lines at the bottom, and match each entry to a plugin, theme or file path.
Each line shows a timestamp, an error level such as PHP Warning or PHP Fatal error, a message, and the file and line number. The path usually tells you which plugin or theme caused it. See how to read the WordPress debug log for worked examples.
Some tips:
- Clear the file before testing, so you see only fresh errors.
- Reproduce the problem once, then read the log right away.
- Ignore deprecation notices at first. Fix fatal errors and warnings tied to your symptom.
- The Query Monitor plugin shows PHP errors per page inside the admin bar, which helps when you cannot reach files.
Should I leave the error log turned on?
No, turn logging off once the problem is fixed, because debug.log can grow large and, in the default location, anyone who guesses the URL can read it.
When you are done, set WP_DEBUG back to false or remove the lines you added. Then delete debug.log.
If you need ongoing logging, use a custom path outside the public folder, or block access to .log files in your server config. The log can reveal file paths, plugin names and sometimes data from database queries, which helps attackers plan an attack.
For broader monitoring, see how to see logs in WordPress, which compares activity logs, error logs and server logs.
What should I check first when there is no error log?
Start with the quickest checks: confirm the constants are above the stop editing line, look for duplicates, force an error, then check permissions and the server log.
A short order of operations:
- Open
wp-config.phpand search for everyWP_DEBUGline. - Fix placement and duplicates.
- Load the failing page.
- Look in
wp-contentand in any custom path. - Create the file by hand if permissions look wrong.
- Check the hosting control panel's error logs.
- Ask your host if none of this shows anything.
Most no error log cases end at step 2 or 3. The rest are usually permissions or a server-level error that WordPress never sees.
Frequently asked questions
Where is the WordPress error log stored?
By default WordPress writes debug.log inside the wp-content folder, but only after debug logging is enabled. If WP_DEBUG_LOG holds a file path instead of true, the log lives at that path. Server-level PHP errors go to your host's error log instead.
Why is debug.log empty even with WP_DEBUG on?
Either no errors have happened since you enabled it, the constants load too late or are defined twice, or the failure happens before WordPress loads. Trigger the broken page again, check placement, and look in the server PHP error log for early fatal errors.
Does WordPress log errors without a plugin?
Yes. The built-in WP_DEBUG_LOG constant writes PHP notices, warnings and errors to a file without any plugin. A plugin such as Query Monitor is optional and simply shows the same errors inside the dashboard, which helps when you cannot open files.
Is it safe to leave debug.log on a live site?
It is not ideal. The default file sits in a public folder, can grow large and may reveal file paths and plugin names. Turn logging off after fixing the issue, delete the file, or move the log to a path outside the web root.
What permissions does debug.log need?
The web server user must be able to write to the wp-content folder or to the log file itself. Folders are usually set to 755 and files to 644. If ownership is wrong after an FTP upload or restore, create the file manually and fix ownership.
Sources
- Debugging in WordPress WordPress Developer Resources
- Changing file permissions WordPress Developer Resources
- Runtime configuration for errors and logging PHP Manual
- Query Monitor WordPress.org Plugins
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.
Related guides
About the editors
Researched from the primary sources listed above and checked against our editorial rules before publishing.


