In this guide, we will go over how to enable WordPress debugging. Note that WordPress does not recommend using the debug mode on live sites you should use it before publishing a site to make sure there is no existing errors before you publish the live site
You can also turn off the error display and log the errors instead.
Enable Debug Mode
The code use to enable the debug mode is located in the wp-config.php file. This file is located on your server and you'll need to access it.
CPanel:
if you are using cPanel you can access the WordPress installation files through file manager. In the file manager find the folder the houses your WordPress installation files. In the root of your WordPress installation folder you should find the wp-config.php file.
The file is a text file and can be edited with any text editor. If you're accessing the follow-through the file manager Interface you can edit it directly by selecting the file, right clicking and then selecting edit.
Once you are able to edit the file scroll down and find the line where it says :
If you find that you're not able to locate this line that's okay. You will simply click on any of the black lines and type in the code that should be there. The code should be:
define ( 'WP_DEBUG', false );
define ( 'WP_DEBUG', true );
To enable debug mode you will need to set the value to true. Exit the file save and reload the page and now your site is in debug mode.
You should now be able to see the errors displayed. For more information check out our article on toggling debug mode error display and debug output to debug log instead.
How to Debug without Access to the Wordpress Installation Folder / File Manager?
You can also try the following:
1. Install and activate WP debugging plugin
2. Trigger the event that has an issue.
3. On the wp-admin bar, go to Debug Quick Look → View File