Turn WordPress debug mode on and off
Definitions
WordPress Debug Mode: A built-in diagnostic tool that reveals hidden PHP errors, warnings, and notices. It helps you easily troubleshoot blank pages, critical errors, broken layouts, and software conflicts by pinpointing the exact plugin, theme, or line of code breaking your website.
Before you start
✅ Website errors are most commonly caused by a WordPress plugin update, a theme conflict, or an incompatible PHP version. Debug mode helps pinpoint the exact cause of the issue.
ℹ️ You will need access to your hosting control panel’s File Manager to complete these steps.
⚠️ Debug mode is a diagnostic tool and should only be used temporarily. Leaving it on permanently can display sensitive server and website information to your public visitors.
🚨 Always remember to turn debug mode off (set it back to false) once you have finished troubleshooting.
Step by step
Turn on WordPress debug mode
- Log in to your hosting control panel
- Open the File Manager tool
- Navigate to the domains folder, select your website’s folder, and open the public_html folder
- Locate the
wp-config.phpfile, right-click it, and select Edit - Scroll through the code until you find the following line:
define( 'WP_DEBUG', false ); - Change the word
falsetotrueso the line looks exactly like this:
define( 'WP_DEBUG', true );
7. Click Save Changes and close the file editor
💡 Tip: If you cannot find that line in your file during step 5, you can type
define( 'WP_DEBUG', true );on a new line right above where it says/* That's all, stop editing! Happy publishing. */.
Check for common errors
- Open a new browser tab and visit your website URL, or the specific page that was having issues
- You will now see lines of text displaying the code errors. Look specifically for lines that start with Fatal error, Parse error, or Warning.
- Read the file path in the error message to identify the culprit:
- Plugin conflicts: If the path includes
/wp-content/plugins/plugin-name/..., that specific plugin is causing the issue. - Theme conflicts: If the path includes
/wp-content/themes/theme-name/..., your active theme is causing the issue.
- Plugin conflicts: If the path includes
- You may also see errors indicating a PHP version conflict (e.g., a message stating a plugin requires a newer or older version of PHP than what your website is currently running).
💡 Tip: Once you identify a broken plugin or theme, you can easily disable it without accessing your WordPress dashboard. In your File Manager, navigate to the
wp-content/pluginsorwp-content/themesfolder, right-click the broken item’s folder, and select Rename. Add-disabledor-oldto the end of the folder name. This forces WordPress to deactivate it and will usually bring your website back online.
Turn off WordPress debug mode
- Once you have identified the errors or fixed the issue, go back to your File Manager
- Navigate to the domains folder, select your website’s folder, and open the public_html folder
- Locate the
wp-config.phpfile, right-click it, and select Edit - Find the debug line and change
trueback tofalse, so the line looks exactly like this:
define( 'WP_DEBUG', false );
5. Click Save Changes
❗Important: After turning debug mode off, make sure to clear your browser cache and your website’s caching plugin (if you use one) to make sure the error messages are no longer visible to your visitors. Double check your website by loading it on a new browser session to make sure debug mode has been completely turned off.
