Today we will discuss WordPress debugging and error logs. Error logs are useful for troubleshooting your WordPress website Users will know the reason behind the downtime on the website. In this guide, we are going to go through the steps required to enable WordPress debugging and error logs and detect error_logs on a WordPress website.
WordPress Debugging and error logs location:
error_logs resides in the website’s root directory and is a PHP log generated by the web server. On some web servers, this is disabled. Debug.log is the log file in the wp-content folder in the root directory of the website.
Note: If you don’t see error logs in the root directory, you need to enable debugging on the website.
Steps to enable debugging and error logging:
- Login to your FTP/File Manager.
- Go to the root directory of your website.
- Open the wp-config.php file in edit mode.

Add the following code to the website.
// Enable WP_DEBUG mode define( ‘WP_DEBUG’, true );// Enable Debug logging to the /wp-content/debug.log file define( ‘WP_DEBUG_LOG’, true );// Disable display of errors and warnings define( ‘WP_DEBUG_DISPLAY’, false ); @ini_set( ‘display_errors’, 0 ); // Use dev versions of core JS and CSS files (only needed if you are modifying these core files) define( ‘SCRIPT_DEBUG’, true );
NOTE:
You must insert the code before /* That’s it, stop editing! Happy blogging. */ in wp-config.php file.
By default “define(‘WP_DEBUG’, false);” The wp-config.php file may already have it, so you can remove it or change the false variable to true

Save the wp-config.php file and reload the website in any browser.
Access the website in the browser so that the logs are generated after enabling the wp-config.php file.
Check the wp-content directory for the debug.log file. It will contain error logs from your WordPress website.
WordPress debugging and error logs setup is complete, now you can open the error log file and check the errors to troubleshoot the website.
Some common errors and their solutions:
The white curtain of death
A plugin is causing compatibility issues. If you can access your website’s WP-Admin, try disabling all your plugins and then re-enabling them one by one. If you can’t access your admin page, go to file manager in cPanel, locate the wp-content/plugins folder and rename the plugins folder to plugins_old. This will disable all your plugins.
Internal Server Errors
The most likely problem is a corrupted .htaccess file. Learn about WordPress security Guidelines. Buy WordPress Hosting and cPanel Hosting.



