How to Check Debug Log File on WordPress

Enable | Disable Debugging WordPress

Heads up: This page may include affiliate links. Read the full disclosure.

WordPress debug logs any errors detected on your website. This is a key to finding the source of an error or learning more details about any possible errors on your site.

One issue with keeping debugging enabled on a WordPress site is that the debug.log file could grow up to 30GB or more in size resulting in eating up a lot of disk space.

This is why it is always recommended to enable debugging only when needed and disable it when done.

To enable or disable debugging in WordPress, navigate to wp-config.php file from your web hosting File Manager and look for the below lines;

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

“true” means debugging is enabled. To disable, write “false” as shown below:

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

The standard location to find the debug.log file would be within the wp-content folder.

The expected default path on the site’s server would be;

/wp-content/debug.log

Check the existing size of the debug.log file. The file can be deleted from the site’s server, which is not publicly accessible.

If the debug.log file is something you want to keep for analysis, then you will need to use an application that can open large log files on your device.

If you want to enable debugging later, the new debug.log file will be created.

If you are looking at a simple plugin to purge the debug.log file, then Debug Quick Log plugin will allow you to view log entries and purge the log from the admin bar of the site.

Ideally, debugging should not be left enabled on a production site long-term.

Useful Links

Looking for something?

Privacy laws apply to businesses that collect personal information. Since no personal information is collected by the MainWP plugins, no privacy laws apply to the MainWP plugins. This includes GDPR, UK DPA 2018, PIPEDA, Australia Privacy Act 1988, LGPD, PIPL, and other privacy laws.
Donata Stroink-Skillrud
Donata Stroink-Skillrud
President of Agency Attorneys