How to Enable and Read the WordPress Error Log
“There has been a critical error on this website.” A white screen. A feature that silently stopped working. The fastest way to find out why is the error log: WordPress can write every PHP error, warning and notice to a file, with the plugin, file and line that caused it.
Step 1: turn on logging (not display)
Open wp-config.php and set these above the line /* That's all, stop editing! */:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true ); // write errors to wp-content/debug.log
define( 'WP_DEBUG_DISPLAY', false ); // don't show them to visitors
@ini_set( 'display_errors', 0 );
Never leave WP_DEBUG_DISPLAY on in production: error messages on the page look broken and can reveal file paths.
You can also send the log to a custom location, for example outside the public folder:
define( 'WP_DEBUG_LOG', '/home/user/logs/wp-errors.log' );
Step 2: reproduce the problem
Visit the page that fails, submit the form, run the action. Then open wp-content/debug.log (via SFTP or your host’s file manager).
Step 3: read it
A typical line:
[25-Sep-2026 10:12:03 UTC] PHP Fatal error: Uncaught Error: Call to undefined function get_field()
in /wp-content/themes/my-theme/single.php:14
- Fatal error: stops the page. Fix these first. The path tells you which theme or plugin, the number is the line.
- Warning: something’s wrong but the page continues.
- Notice / Deprecated: minor or future problems; worth fixing, not urgent.
The example means the theme calls an ACF function while ACF isn’t active. Common fixes: reactivate the plugin, update the one that errors, or wrap the call in if ( function_exists( 'get_field' ) ).
Step 4: turn it off again
The log grows quickly and debugging adds a little overhead. When you’re done, set WP_DEBUG back to false, and delete or archive the log.
From wp-admin with DevKit
Editing wp-config.php and downloading logs over FTP is slow, especially on client sites. DevKit does it from the dashboard:
- Enable debug in one click in DevKit’s Settings, with options to create a log file, set a custom folder and file name, display errors, log JavaScript errors and save queries.
- Error Log page in the DevKit sidebar with syntax highlighting, the last-changed date, Copy Log, Reload and Clear log buttons.
- Filter by type in Settings, to see only the kinds of errors you care about.
