WordPress is a dynamic CMS, which means code is constantly running in the background to generate the pages you see. Occasionally, you may experience conflicting code between plugins, code syntax errors in your theme, broken code snippets in your functions.php file, and other PHP-related issues.
To tackle these problems, enabling debug mode can help you or your developer troubleshoot your site. Normally, enabling debug mode requires you to edit your
wp-config.php file via SSH or SFTP. This can be inconvenient, especially if you don’t have your login credentials handy or an SFTP client installed.
In most cases, WP_DEBUG shouldn’t be used on a live environment. It’s a useful feature for debugging, but it can reveal text from your PHP code to visitors on your site. Use it on your staging environment.
Enabling WordPress Debug Mode in MyKinsta
If your site is hosted on Kinsta, enabling debug mode is a much quicker process thanks to the WordPress Debugging tool in the MyKinsta dashboard. To enable debug mode, navigate to your site’s “Tools” page and click Enable under “WordPress Debugging”.
With debug mode enabled, you’ll see PHP errors displayed on your site at the top of the page, in addition to your error logs in MyKinsta. The screenshot below shows a typical PHP error with debug mode enabled.
The presence of PHP errors at the top of the page don’t make for a good user experience for your site’s visitors. With that in mind, we only recommend enabling debug mode in a staging environment.
However, if you have to enable it for your live environment, we recommend doing so during low traffic hours and minimizing the amount of time with debug mode enabled.
Once you are finished with troubleshooting your WordPress site, you can disable debug mode by clicking Disable in the “WordPress Debugging” tool.
Here at Kinsta, we are constantly developing useful tools in MyKinsta to speed up your WordPress workflow. With our WordPress Debugging tool, you can easily enable and disable debug mode without touching a single line of code. To learn more about debugging WordPress, check out our in-depth guide here!
If you enjoyed this tutorial, then you’ll love our support. All Kinsta’s hosting plans include 24/7 support from our veteran WordPress developers and engineers. Chat with the same team that backs our Fortune 500 clients. Check out our plans