WordPress Error Log Location: How to Turn On, Find and Read WordPress Error Logs
Where the WordPress error log is, how to turn on WP_DEBUG_LOG safely, where hosts keep PHP error_log files, and how to read a fatal error line.
On this page
- WordPress keeps no error log until you set WP_DEBUG and WP_DEBUG_LOG to true in wp-config.php; errors then go to /wp-content/debug.log.
- The server's own PHP error_log file and the hosting panel's error page record problems even when WordPress debugging is off.
- Keep WP_DEBUG_DISPLAY false on a live site, log to a private path or delete debug.log afterwards, and turn debugging off when done.
WordPress does not keep an error log until you turn one on: add define( 'WP_DEBUG', true ); and define( 'WP_DEBUG_LOG', true ); to wp-config.php, and errors are written to /wp-content/debug.log. Separately, your server keeps its own PHP error log, usually a file called error_log or a log viewer in the hosting panel.
Those two places answer almost every "where are my WordPress errors" question. The rest of this guide shows how to switch logging on without showing errors to visitors, where each host type keeps the files, and how to read the lines you find.
Where WordPress error logs are kept
| Log | Usual location | What it records |
|---|---|---|
| WordPress debug log | /wp-content/debug.log (only after you enable it) | PHP notices, warnings and fatal errors raised while WordPress runs |
| PHP error log | A file named error_log in the site root or /wp-admin/, or a path set by the host | PHP errors even when WordPress debugging is off |
| Web server log | Hosting panel, for example cPanel > Metrics > Errors or hPanel's log section | 500, 403 and timeout errors from Apache, LiteSpeed or Nginx |
| WooCommerce logs | WooCommerce > Status > Logs | Payment gateway, webhook and fatal error logs for the store |
A fatal error email from WordPress ("Your Site is Experiencing a Technical Issue") also names the file and line. It goes to the admin email in Settings > General, so check that address is yours and not an old developer's.
How to turn on the WordPress error log
- Take a backup of
wp-config.php, or copy it to your computer first. - Open the file. Use File Manager in your hosting panel or SFTP, and open
wp-config.phpin the site root. - Find the existing WP_DEBUG line. Most installs already have
define( 'WP_DEBUG', false );. Replace it rather than adding a second copy, because a duplicate define causes its own warning. - Paste these lines above
/* That's all, stop editing! */:define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false ); @ini_set( 'display_errors', 0 ); - Reproduce the problem. Load the broken page, save the post or run the checkout that fails.
- Open
/wp-content/debug.login File Manager and read the newest lines at the bottom.
WP_DEBUG_DISPLAY set to false keeps errors out of the page, so visitors do not see paths or messages. Logging works on a live site this way.
Log to a private location
By default debug.log sits in wp-content, which a browser can often open by URL. Since WordPress 5.1 you can give a path instead of true:
define( 'WP_DEBUG_LOG', '/home/youruser/logs/wp-debug.log' );
Use a folder above public_html so it can't be downloaded. If you leave the default path, delete the file when you finish.
How to find the PHP error log on your host
- cPanel hosts: look for an
error_logfile inpublic_htmland inpublic_html/wp-admin. cPanel > Metrics > Errors shows the last web server errors. - Hostinger hPanel: open the website, then search the sidebar for logs or check Advanced > PHP Configuration to confirm error logging is on; error files appear in the site's folders through File Manager.
- Managed WordPress hosts usually give a log viewer in their dashboard (for example under the site's Logs or Tools tab) rather than file access.
- VPS with Nginx: check
/var/log/nginx/error.logand the PHP-FPM log, often under/var/log/with the PHP version in the name. - Still not sure? Create a temporary PHP file with
<?php phpinfo();, open it, and search forerror_logto see the exact path. Delete the file straight after.
How to read a WordPress error log line
A typical line looks like this:
[11-Nov-2026 06:42:10 UTC] PHP Fatal error: Uncaught Error: Call to undefined function some_function() in /home/user/public_html/wp-content/plugins/example-plugin/inc/init.php:42
- The time is usually UTC, which is 5 hours 30 minutes behind India time. Match it to when you saw the problem.
- The level tells you how serious it is. A Fatal error stops the page. Warning, Notice and Deprecated lines rarely break anything.
- The path names the culprit.
/plugins/example-plugin/points to that plugin,/themes/to the theme, and/wp-includes/usually means a plugin passed bad data into core. - The line number is what a developer needs. Copy the whole line, including the stack trace below a fatal error.
Once you know the plugin, deactivate it from Plugins > Installed Plugins, or rename its folder over SFTP if the admin won't load. Our guide to fixing the WordPress critical error walks through that part.
Edge cases that hide errors
- The log stays empty. A caching plugin or server cache may be serving an old copy of the page, so PHP never runs. Purge the cache, or test while logged in.
- Constants defined twice. Some hosts or security plugins add their own
WP_DEBUGline further downwp-config.php. The first one wins, so search the whole file. - Errors from a must-use plugin. Files in
/wp-content/mu-plugins/can't be deactivated from the Plugins screen; they have to be renamed or moved. - A huge debug.log. Old notices can grow the file to hundreds of megabytes and use up disk space. Delete or rename it before testing so you only see fresh lines.
- Memory errors. "Allowed memory size exhausted" lines point to the memory limit rather than one plugin; see WordPress memory limit errors.
Turn logging off when you finish
- Set
WP_DEBUGback tofalseinwp-config.php. - Delete
/wp-content/debug.log, or the custom log file, so file paths are not left readable. - Clear any cache and check the front end once.
If you'd rather someone else watched logs, updates and backups each month, that is part of our WordPress maintenance service.
FAQs
Where is the WordPress error log by default?
There isn't one until you set WP_DEBUG_LOG to true. After that the file is /wp-content/debug.log.
Can I view WordPress error logs from the dashboard?
Not by default. WooCommerce stores have WooCommerce > Status > Logs, and some hosts and log viewer plugins show debug.log inside the admin. For a white screen you still need File Manager or SFTP.
Is it safe to keep WP_DEBUG on a live site?
Only for a short time, with WP_DEBUG_DISPLAY false and the log outside the public folder or deleted afterwards.
Why does debug.log not appear?
Either no error has happened since you enabled it, the folder isn't writable, or another WP_DEBUG line overrides yours. Check file permissions on wp-content and search wp-config.php for duplicates.
Need help with your website?
I'm a freelance WordPress developer building fast, SEO-friendly websites since 2020. Tell me what you need and I'll reply with a plan and a fixed quote, usually within 24 hours.

