How to Change the debug.log Storage Location

Change Debug Log Location - WordPress

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

It is beneficial if you temporarily enable debugging on your WordPress site to run down any issues happening with the site from active themes, WordPress core version, or active plugins.

The default location to store the debug.log file is /wp-content/debug.log, but if you want to change the path where the debug.log file should be stored, add the following snippet into the wp-config.php file replacing the /tmp/ with your folder preference.

define( 'WP_DEBUG_LOG', '/tmp/wp-errors.log' );

If you are uncomfortable editing the wp-config file, you can use the plugin “Change Debug Log Location

Change Debug Log Location Plugin

If you are using the Really Simple SSL plugin on your site, it comes with a hardening feature covering changing the debug.log storage location.

It is not recommended to keep debugging enabled long-term on a site; think of debugging as a valuable tool in WordPress. Also, if you can not resolve the errors logged into the site debug.log file, that file can easily keep writing to the log file and become large.

Since, by default, the debug.log file will not be truncated if it goes over a set size, such as 256 MB. So it’s suggested to remove the file when work has been done.

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

Your Download Is Just One Click Away

…or just download the plugin.

By entering your email, you agree to our Terms of Service and Privacy Policy.