How to Enable WordPress Debug Mode Safely
When your WordPress site breaks โ a white screen, a plugin error, or an unexpected crash โ WordPress typically swallows the actual PHP error and shows you nothing. Debug mode forces WordPress to surface those hidden errors so you can fix them. Here is how to enable it safely on your Hostinap Shared or Business Hosting account without exposing error details to your site visitors.
Step 1: Open wp-config.php
- Log in to cPanel > File Manager.
- Navigate to your
public_htmldirectory. - Find
wp-config.php, right-click it, and choose Edit. Click Edit in the confirmation dialog.
Step 2: Add the Debug Constants
Locate the line that reads:
define( 'WP_DEBUG', false );
Replace it (or add these lines directly above the /* That's all, stop editing! */ comment) with:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
- WP_DEBUG true โ Turns on error detection.
- WP_DEBUG_LOG true โ Saves all errors to a log file (
wp-content/debug.log) instead of displaying them on screen. - WP_DEBUG_DISPLAY false โ Prevents errors from being shown to your website visitors. Always set this to false on a live site.
Click Save Changes.
Step 3: Reproduce the Error and Check the Log
- Visit your website and reproduce whatever action was causing the error (load the page, submit the form, etc.).
- Go back to cPanel File Manager and navigate to
public_html/wp-content/. - Open the
debug.logfile. Scroll to the bottom to see the most recent errors.
You will see entries like:
[22-Aug-2026 02:30:00 UTC] PHP Fatal error: Call to undefined function
my_plugin_function() in /home/user/public_html/wp-content/plugins/my-plugin/my-plugin.php on line 47
This tells you the exact plugin file and line number that is broken.
Common Error Types and What They Mean
- PHP Fatal error: Something critical broke โ a function doesn't exist, a class is missing. Usually caused by a plugin or PHP version incompatibility.
- PHP Warning: Non-critical issue that the code handled, but it indicates sloppy code or an outdated plugin.
- PHP Deprecated: A function that used to work is scheduled for removal in a future PHP version. Safe for now, but worth noting.
Step 4: Disable Debug Mode When Done
Once you have identified and fixed the issue, immediately return to wp-config.php and set all debug constants back:
define( 'WP_DEBUG', false );
define( 'WP_DEBUG_LOG', false );
define( 'WP_DEBUG_DISPLAY', false );
Also delete the debug.log file from wp-content/ โ it can grow very large and contains sensitive path information.
Need Immediate Help?
Share your debug.log output with our team on WhatsApp and we will diagnose the root cause for you โ no need to interpret cryptic PHP errors yourself.