Access the wp-config.php
file located in the root directory to disable debugging.
define('WP_DEBUG', false);
define('SCRIPT_DEBUG', false);
error_reporting(0);
@ini_set('display_errors', 0);
Now insert the above code into the file and save it.
Here’s a brief explanation of each:
-
define('WP_DEBUG', false);
- When set to
true
, this activates the Debug mode in WordPress. When activated, errors will be logged in the debug.log file.
- When set to
-
define('SCRIPT_DEBUG', false);
- When set to
true
, this activates the debug mode for JavaScript and CSS files in an “uncompressed” state. This can ease development and bug fixes in your scripts.
- When set to
-
error_reporting(0);
- This function sets the error level of PHP. By your setting, no errors will be displayed (0).
-
@ini_set('display_errors', 0);
- This function attempts to turn off the display of PHP errors in a live environment. The “@” symbol before
ini_set
prevents the display of errors in case the display events fail.
- This function attempts to turn off the display of PHP errors in a live environment. The “@” symbol before
Note that at the end of the wp-config.php
file, make sure there are no additional entries that may change these settings. This is important to ensure that the debugging and error settings are applied according to PHP settings.