Free tool · no sign-up
WordPress debug mode, set up safely
Pick what you're trying to do and copy the lines into wp-config.php. The default logs errors to a file without showing them to your visitors.
Paste it above the line /* That's all, stop editing! Happy publishing. */. If wp-config.php already has a define( 'WP_DEBUG', false ); line, replace that line instead of adding a second one.
Where the error log is
With WP_DEBUG_LOG set to true, WordPress writes errors to wp-content/debug.log. Open it with your host's file manager or over FTP. The newest errors are at the bottom.
That file can be read by anyone who guesses its address, and it can contain file paths and other details. Either save the log outside the public folder (the option above), or block it by adding this to .htaccess:
<Files debug.log> Require all denied </Files>
What each line does
WP_DEBUG: turns WordPress's error reporting on or off.WP_DEBUG_LOG: writes errors to a file.truemeanswp-content/debug.log; a path in quotes saves it there instead.WP_DEBUG_DISPLAY: shows errors on the page. Keep thisfalseon a live site.@ini_set( 'display_errors', 0 ): makes sure PHP itself doesn't print errors either.
debug.log isn't being created?
WP_DEBUGmust betruetoo.WP_DEBUG_LOGon its own does nothing.- The lines are below “That's all, stop editing!” WordPress has already loaded by then, so they're ignored. Move them above it.
- There's a second
WP_DEBUGline further down setting it back tofalse. - The folder isn't writable. WordPress needs permission to create files in
wp-content, or in the custom folder you chose. - No error has happened yet. The file only appears after the first error. Reload the broken page, then look again.
Turn it off when you're done
Debug logging on a busy site fills the disk over time. When you've found the problem, switch to "Done" above, and delete debug.log.
Seeing "There has been a critical error on this website"?
WordPress usually emails the site's admin address a link to recovery mode, which lets you log in with the broken plugin or theme paused. The debug log tells you which one it was. Still stuck? Emergency Fix, $129.
FAQ
Questions people ask
How do I turn on debug mode in WordPress?
Add define( 'WP_DEBUG', true ); and define( 'WP_DEBUG_LOG', true ); to wp-config.php, above the “That's all, stop editing!” line. Keep WP_DEBUG_DISPLAY false on a live site. The tool above writes the lines for you.
Where is the WordPress error log?
With WP_DEBUG_LOG set to true, it's wp-content/debug.log. Your host also keeps a server error log, usually under “Logs” in the hosting panel, which catches errors that happen before WordPress loads.
Is it safe to enable debug mode on a live site?
Yes, if errors go to the log and not the screen (WP_DEBUG_DISPLAY false), and the log file is protected or kept outside the public folder. Turn it off when you've found the problem.
What is WP_DEBUG_DISPLAY?
It decides whether errors are printed on the page. On a live site keep it false: printed errors look broken to visitors and can reveal file paths.
Why is my debug.log so big?
Every notice and warning is written to it, and on a busy site that adds up fast. Fix or report the repeated warnings, and delete the file once you're done debugging.
Rather have someone else do it?
A Quick Fix is $69: one problem, about an hour of work, with a backup first and a note of what I changed.
Fixed price before I start · backup first · no fix, no fee · or run the free scan