WP_DEBUG: Enable error logging in WordPress

In some cases our support staff might ask you to attach an error log file to your support ticket. This article explains how you retrieve that file in WordPress.

Have you edited code before? In order to enable WordPress’ debug mode and error logging, the wp-config.php file on your server needs to be edited. It is perfectly ok if you don’t feel comfortable doing so! Please let our support staff know about it, so we can assist you better.

  1. Open your wp-config.php and replace this line:

  2. define('WP_DEBUG', false);
    	
    with these 3 lines:

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

    In case the first line is not present already in your wp-config.php, just add the 3 lines.

    Note: The above code needs to be inserted before the /* That's all, stop editing! Happy blogging. */ line.

  3. Save the file, go back to WordPress and try to do whatever you were doing when the behavior had occurred first.

    Once you have done so, a file named debug.log will appear in the wp-content folder of your WordPress install (you may have to refresh the folder view in your FTP client).

  4.  Download the debug.log file and send it to our support staff.
  5. Set the line of WP_DEBUG back to false:
  6. define('WP_DEBUG', false);
    	

    Heads up! You can leave the other 2 lines you had added, but if you don’t set WP_DEBUG to false again, the debug file could easily grow in size very fast; so make sure you complete this last step.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.