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 );
“true” means debugging is enabled. To disable, write “false” as shown below:
define( 'WP_DEBUG', false );
define( 'WP_DEBUG_LOG', 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;
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.