Turn on WordPress Error Reporting

Comment out the top line there, and add the rest to your wp-config.php file to get more detailed error reporting from your WordPress site. Definitely don't do this live, do it for local development and testing.

// define('WP_DEBUG', false);

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);


  1. User Avatar
    Permalink to comment#

    Nice one Chris. Thanks.

  2. User Avatar
    Permalink to comment#

    for a live website I would recommend:

    define('WP_DEBUG', false);
    @ini_set('error_log','phperrors.log'); // path to server-writable log file

    don’t forget to drop a phperrors.log file inside your remote directory with write permissions

    • User Avatar
      Willem-Siebe Spoelstra
      Permalink to comment#

      What does make you code any different then:

      define('WP_DEBUG', true);
      define('WP_DEBUG_LOG', true);
      define('WP_DEBUG_DISPLAY', false);


    • User Avatar
      Permalink to comment#

      Thanks @geopaL!

      I have the same question as @Willem-Siebe Spoelstra does.

      Why do you recommend that code instead of using the WordPress constants WP_DEBUG, WP_DEBUG_LOG and WP_DEBUG_DISPLAY? I know they are meant for local testing and staging installs but…what are the advantages of the code you have provided? Is it for performance reasons?

      The only thing that comes into my mind is the fact that Enabling WP_DEBUG will consume extra system resources trying to detect deprecated WordPress functions and arguments that are being used.


  3. User Avatar

    Not sure where the errors get reported to with this turned on.. is there a log file somewhere?

    • User Avatar

      Answered my own question on the codex.

      * This will log all errors notices and warnings to a file called debug.log in
      * wp-content (if Apache does not have write permission, you may need to create
      * the file first and set the appropriate permissions (i.e. use 666) )
      define(‘WP_DEBUG’, true);
      define(‘WP_DEBUG_LOG’, true);
      define(‘WP_DEBUG_DISPLAY’, false);

  4. User Avatar
    Permalink to comment#

    I need your help when I log in my dashboard is a blank page. I tried to rename my file via FTP using Filezilla but nothing is coming up. Do you have any advices for me. Thanks you.

  5. User Avatar
    Permalink to comment#


    you may try plugin https://wordpress.org/plugins/debug/ to Debug all issues in WordPress site. and you not need to edit php code in wp-config file.

    • User Avatar
      Jim Kyle
      Permalink to comment#

      SoniNow: Your “debug” plugin seems like the ideal solution to my own need, but I’ve not been able to get it to work. Initially it made it impossible to access my test site at all, but restoring config.php from the backup copy solved that and I discovered that the 0600 permission with which it wrote the changed config.php file prevented my server (on localhost) from accessing it at all. This might be what caused Alice’s situation. Changing the permission to 0664 eliminated the login problem but the plugin still failed under WordPress 4.3…

  6. User Avatar
    Willem-Siebe Spoelstra
    Permalink to comment#

    Hi, I don’t understand the advice:

    Definitely don’t do this live, do it for local development and testing.

    I understand you don’t want to ‘show’ the errors to public and for that you define WP_DEBUG_DISPLAY to false. But why is it bad practice to ‘log’ the errors to a log file?

    Kind regards,


Leave a Comment

Posting Code!

You may write comments in Markdown. This makes code easy to post, as you can write inline code like `<div>this</div>` or multiline blocks of code in triple backtick fences (```) with double new lines before and after.

Code of Conduct

Absolutely anyone is welcome to submit a comment here. But not all comments will be posted. Think of it like writing a letter to the editor. All submitted comments will be read, but not all published. Published comments will be on-topic, helpful, and further the discussion or debate.

Want to tell us something privately?

Feel free to use our contact form. That's a great place to let us know about typos or anything off-topic.