The debug mode in WordPress is a very useful feature. If your site is down and you don't know why, the first step is to enable debugging and any warnings and errors will be displayed directly on your site, even if the primary site doesn't load. Simply follow these steps.
- Connect to your site files via SFTP - You can use an FTP program such as Filezilla to connect to your server files.
- If you haven't done so already, you will need to enable SFTP on your site first.
- Go to the public_html (root) folder of your website. Find the wp-config.php file.
- Download a copy of the file to your computer.
- Open the file using a code editor such as Notepad++.
- Before making any changes it is a good idea to save a copy of the original file in case you need to revert back to it quickly.
- In the file, search for "WP_DEBUG" and change the value of it from "false" to "true"
if ( ! defined( 'WP_DEBUG' ) ) { define( 'WP_DEBUG', true ); }
- After making the necessary modifications to your file, simply upload it back to your server using an FTP client, and replace the original file with the modified version.
- Reload your website and any warnings/errors will now display directly on your site.
To disable the debug mode, simply switch the WP_DEBUG value back to "false"
if ( ! defined( 'WP_DEBUG' ) ) {
define( 'WP_DEBUG', false );
}