View Categories

Enable WordPress Debug Log

You are here because of a fatal error or a blank white page. The debug log turns that into an actual file name and line number.

Three lines in wp-config.php and WordPress writes every PHP error to disk.

Turn it on

  1. Get to your site’s files, through your host’s file manager or over FTP.
  2. Open wp-config.php in the root of your WordPress install.
  3. Add these three lines, or change the values if they are already there:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

Copy them exactly. A missing semicolon in wp-config.php takes the whole site down, which is a memorable way to learn this.

  1. Paste them directly above this line:
/* That's all, stop editing! Happy publishing. */
The three debug lines added to wp-config.php

Read the log

Reload the page that was failing, then open:

wp-content/debug.log

The last entries are the ones you want. A fatal error names the file and the line, and that alone usually identifies which plugin or theme is responsible.

Show errors on screen instead

If you would rather see them in the page than open a file, change one line:

define( 'WP_DEBUG_DISPLAY', true );

Do this on a staging site or at a quiet moment. It shows the errors to whoever is looking at the page, visitors included.

Turn it off afterwards

Set WP_DEBUG back to false when you are done. A debug log left running grows, and on a busy site it grows quickly.

What to do with what you find

If the error names a 99Plugs plugin, open a ticket and paste it in. That log line is the single most useful thing you can give us, and it usually turns a long conversation into a short one.

If it names something else, Something broke after I installed or updated a plugin is the next step.

WordPress documents all of this in more depth in Debugging in WordPress.