When your WordPress site shows a blank white screen or behaves unexpectedly, PHP errors are often the cause. WordPress includes a built-in debugging system that you can activate by editing a single configuration file, giving you visibility of the errors your site is generating.
By the end of this guide, you will have WP_DEBUG configured in your wp-config.php file and be able to view or log PHP errors to diagnose what is going wrong.
wp-config.php file in the root directory of your WordPress installation, typically public_html/.WP_DEBUG set to true on a live site once you have finished diagnosing the problem.WordPress reads its debug configuration from constants defined in wp-config.php. Setting WP_DEBUG to true tells WordPress to report all PHP errors and notices, including those triggered by plugins and themes. By default this constant is set to false, so errors are suppressed.
wp-config.php and select Edit.define( 'WP_DEBUG', false );. This line is present in all standard WordPress installations.false to true so the line reads as follows:define( 'WP_DEBUG', true );
WP_DEBUG back to false and save the file. Leaving debug mode active on a live site exposes internal file paths and error details to visitors.
Displaying errors on screen is useful during local development, but on a live site you may prefer to write errors to a log file so they are not visible to visitors. The three constants below work together: WP_DEBUG activates error reporting, WP_DEBUG_LOG writes errors to a file, and WP_DEBUG_DISPLAY controls whether they appear on screen.
Add or update the following lines in wp-config.php, above the line that reads /* That's all, stop editing! Happy publishing. */:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
With this configuration, WordPress writes all PHP errors to wp-content/debug.log without displaying them to visitors. You can review this file at any time using File Manager or an FTP client. If you want errors written to a different location, set WP_DEBUG_LOG to the full file path instead of true, for example define( 'WP_DEBUG_LOG', '/home/username/logs/wp-errors.log' );.

If you set WP_DEBUG to true but no errors appear on screen, WP_DEBUG_DISPLAY may already be defined elsewhere in wp-config.php and set to false. WordPress also suppresses error display automatically for REST API, Ajax and XML-RPC requests, so errors from those request types will not appear in the browser regardless of your settings.
wp-config.php for any existing WP_DEBUG_DISPLAY definition and remove or update it.WP_DEBUG_LOG and check wp-content/debug.log for errors that are being suppressed from the screen.If WP_DEBUG_LOG is set to true but no debug.log file appears in wp-content/, the web server process may not have write permission to that directory.
wp-content/ directory. It should be set to 755.WP_DEBUG is also set to true. WP_DEBUG_LOG has no effect unless WP_DEBUG is active.WP_DEBUG_LOG to an absolute file path in a directory you know is writable.You have configured WordPress debug mode by editing wp-config.php. You can now display PHP errors on screen during diagnosis or write them silently to wp-content/debug.log while keeping your site looking normal to visitors.
Once you have resolved the underlying error, remember to set WP_DEBUG back to false. For related tasks, see our guides on removing malware from WordPress, increasing the WordPress memory limit and fixing common website error codes.
If you are running WordPress on managed hosting, our WordPress hosting plans include tools to help you monitor and maintain your site.
Get fast, secure and reliable WordPress Hosting with optimised for performance with AccelerateWP.
Get WordPress HostingCreate fully isolated individual accounts for your clients and manage them all from one dashboard.
Get Reseller Hosting