Enable WordPress error logging

WordPress can log PHP errors and warnings to a debug log file on your server.
Enabling this log helps diagnose issues with Jetpack and other plugins by revealing
errors that don’t appear in your browser.

Sharing the log with Jetpack Support

If you contact Jetpack Support about an error, you can share relevant lines from
debug.log to help with diagnosis. Look for lines that include Jetpack or the
name of the plugin or feature you are troubleshooting.

Enable the WordPress debug log

WordPress debug logging is controlled by constants in your site’s wp-config.php
file. To enable it:

  1. Connect to your site via FTP or your host’s file manager.
  2. Open wp-config.php in a text editor.
  3. Add the following lines above the /* That's all, stop editing! */ comment: define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );
  4. Save the file.

WP_DEBUG enables error detection. WP_DEBUG_LOG writes errors to a log file
instead of displaying them on screen. WP_DEBUG_DISPLAY set to false keeps
errors out of your site’s frontend.

Alternatively, your hosting provider should be able to help you enable the debug log.

Find the error log

Once enabled, WordPress writes errors to a file named debug.log in the
wp-content/ directory. You can access it via FTP, your host’s file manager,
or SSH. If need assistance obtaining this file, your host should be able to get it for you.

If the file does not exist yet, it will be created automatically the next time
a PHP error occurs.

Disable debug logging

After resolving the issue, remove or comment out the debug constants in
wp-config.php to disable logging. Leaving WP_DEBUG enabled on a live site
can expose error details to visitors.

Still need help?

Please contact support. We’re happy to advise.

Was this article helpful?