Fix it safely · Action guide

How to turn on WordPress debug mode and read the error log

When something breaks, WordPress shows a vague message, or nothing. The real error is hidden on purpose. Debug logging writes it to a file you can read, without showing it to visitors.

Site down right now? Call us 0191 580 4040 Mon-Fri, 9am-5:30pm
Not urgent? Contact us

What this usually means

Once you have the error, the file path tells you who’s at fault. A path that includes /wp-content/plugins/ names a plugin, and /wp-content/themes/ names a theme.

  • Fatal error: something stopped the page
  • Warning: something is wrong, but the page carried on
  • Notice or deprecated: minor, or a sign of trouble ahead

Step by step

  1. Take a backup first

    Always, before editing wp-config.php.

  2. Add the three lines

    Put them in wp-config.php above the line that says to stop editing. They turn on logging and keep errors off the page.

  3. Reproduce the problem

    Reload the page that fails, then open wp-content/debug.log over SFTP.

  4. Read the first fatal error

    Note the file path and line number, and what it says. Then switch debugging off and delete the log.

wp-config.php
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

When to get help

If the error means nothing to you, send us the first few lines of the log, without any passwords. It’s usually enough for us to say what’s wrong.

Send us the details

Frequently asked questions

Is debug mode safe on a live site?

With display turned off and the log deleted afterwards, yes. Never leave errors showing to visitors.

Where is the debug log?

In the wp-content folder, as debug.log.

Why is the log empty?

The problem may not be in WordPress, so check your host’s server error log as well.

Call us Get in touch