In this guide you will learn to how to enable debugging in WordPress, to help find the root of the problem you are facing.
Method 1: Debugging WordPress Using A Plugin
We’ve found this useful plugin by Andy Fragen, that enables error logging when the plugin is active and details can be access via the WordPress dashboard, you can use the below link to download and install the plugin (or install it directly from within your WordPress Dashboard).
Method 2: Debugging WordPress via FTP
Debugging WordPress the manual way requires a bit of FTP knowledge and being comfortable in working with some files and navigating your web hosting control panel.
Editing Files On Your Site
Editing files on a live site can be risky, the most common way of editing files on a live website will be by using FTP, cPanel or some other file manager that is similar. Before moving forward, ensure you have a recent backup available. If you are uncertain about FTP or cPanel – you may reach out to your hosting provider for these details. We recommend Cyberduck when connecting to sites via FTP.
Enabling Debug Mode In WordPress
Once you are confident enough in using FTP to edit files on your site, you are ready to enable debugging in WordPress. Follow these simple steps –
- Login to your site via FTP using Cyberduck.
- Navigate to your WordPress install directory and enter it (usually public_html or www).
- Find wp-config.php file and edit with a text editor of your choice. If you don’t have a cool text editor, be sure to check-out Atom – it’s free.
- Search the file for the following line of code: define( ‘WP_DEBUG’, false );
- Change this from false to true. This will now output errors to your site, although it will conflict with functionality.
- Directly below this you will enter two new lines of code:
- define( ‘WP_DEBUG_DISPLAY’, true );
- define( ‘WP_DEBUG_LOG’, true );
- Save your file and re-upload to the same directory – overwrite the file when prompted. (Do not close Cyberduck just yet).
- Go back to your website using your browser and recreate the issue.
- Head back on over to FTP and navigate to wp-content and expand the folder, your debug.log file will be loaded into this directory if there are any PHP errors.
- Download the debug.log file and send it to your support thread.
Summary For Debugging In WordPress
In this guide we covered two possible ways of enabling debugging in WordPress, by either installing a plugin or using FTP/code to find out the root of the problem.
If you use the WP Debugging Plugin, this will be done automatically for you when activating and deleting the plugin.
Inside your wp-config.php file you will need to have the following lines of code to enable debugging in WordPress feature.
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'WP_DEBUG_LOG', true );
Once the above is enabled a debug.log file will be generated and added it to your wp-content directory. Download the debug.log and add it to your support thread reply. Once you have completed the steps above, be sure to delete the debug.log file and disable debug logging.
For more detailed information for debugging in WordPress, you may have look at the WordPress codex.