0

I just want some information about WP_DEBUG.

What happen if I comment this line in wp-config.php files

define('WP_DEBUG',true);

I had an issue on the site where my server getting down and database where crashing, so my server guy advice me that, this comment code is causing issue on the server and the database and please uncomment this.

Can someone please advice, that commenting this code can cause issue on server or the database ?

  • This is basically a property that when defined and set to true, WordPress will throw any errors (fatal or not) at your face, for debugging purposes. Commenting it out (//define('WP_DEBUG',true);) or setting it to false (define('WP_DEBUG',false);) will not result in such issues you're addressing, make sure you fix any important errors as you debug.. – Samuel Elh Jan 7 '17 at 14:48
  • you should set it to false. .. – Dev02ali Jan 7 '17 at 16:49
1

IMHO WP_DEBUG allows to enable display of notices during development. If you look at the core file default-constants.php you see this :

if ( !defined('WP_DEBUG') )
    define( 'WP_DEBUG', false );

So I don't see why you should set it to false again in wp-config.php.

Regarding your issue just delete the line, WP_DEBUG should never be used on a live website, it's a developer tool.

The fact that the constant cannot cause anything it's a display tool. However maybe we have to admit that in a very weird universe bad things happen such as error display on a live site. If that's the case you can leave the WP_DEBUG constant set to true and hide display like that :

define( 'WP_DEBUG_DISPLAY', false );

Your server guy should know that errors should never be shown on a live website.

Source

0

Setting WP_DEBUG to true will show that you have errors on your website, but shouldn't cause them. Rather than commenting out this code—if you want to disable it—you should set it to false instead.

0

If you don't know, what this line of code is good for, I recommend you to remove it (just this one).

As stated by JMau, WP_DEBUG is only for development. If you activate the debug mode by adding define('WP_DEBUG',true); to your wp-config.php your website will display sensitive data to all of your visitors.

If you're experiencing some PHP or database error, this at least would look ugly. An attacker could use the provided information for hacking into your blog.

And: in combination with other DEBUG settings (like SAVEQUERIES), WP_DEBUG can lead to performance issues.

I suggest you read more about debugging in WordPress on the official codex site: Debugging in WordPress

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.