WP Debug Display False Not Working

I moved an old website from cPanel to Localhost and noticed a bunch of front-end errors. This despite having debugging disabled in wp-config.php.

define( 'WP_DEBUG', false );

So, I went on to add the line:

define( 'WP_DEBUG_DISPLAY', false );

That didn’t work! Apparently, the reason for this is that WP_DEBUG has no impact on PHP error output. So, when using WordPress on Localhost and there are PHP errors front-end, the way to hide them is using your php.ini file as follows:

display_errors = 0 

* If you’re using XAMMP, like me, you should find this file under xampp\php\php.ini. If it isn’t there, you can use your control panel > config button to find it.

Alternatively, you can also add the following line in your wp-config.php file:

@ini_set( 'display_errors', 0 );

Hope this helps!

For more info, see Debugging in WordPress.

Leave a Comment

Your email address will not be published. Required fields are marked *