Enabling debug mode in wordpress displays the PHP errors, notices and warnings throughout the wordpress site. Developer can easily debug the code errors on wordpress site once the errors info is displayed on error pages.
When wordpress is not in debug mode, PHP displays only fatal errors or sometimes it displays nothing (White Screen Of Death).
Below are the easy steps to enable debug mode in wordpress
Enabling debug mode using wp-config.php
- Access your site’s root directory via FTP
- Find and Open wp-config.php file
- Find PHP variable WP_DEBUG
- If it is found, by default it will be set to false as shown below. Make it to true; replace false with true
define( 'WP_DEBUG', false );
Else, add below line BEFORE /* That's all, stop editing! Happy blogging. */
define( 'WP_DEBUG', true );
5. Save the file and upload it to the site’s root directory
Now refresh the error page where you see fatal error or white screen of death on wordpress site. The page will display the PHP errors and warnings.
- Do not enable debug mode on live site as the error information will be displayed to the users which increases the risk of your site’s security
- Set WP_DEBUG to false after debugging and fixing the wordpress errors
- If you don’t see any errors even after enabling debug mode, then the problem could be something else on your wordpress like settings etc.