How to disable WordPress PHP errors

Reading Time: < 1 minute

Common scenario is where PHP errors appears on the WordPress website after updating or activating new theme or plug-in.

PHP errors WordPress generates are usually just warnings and notices, and those does not stop website loading, but errors look seriously bad and broke design, so you should definitely disable them.

Reason for those errors can be various, and ultimately you should fix the root cause. However, in the first place you can just turn off WordPress PHP errors. After that everything looks normal for your visitors.

You need to edit php-config.php file located at the WordPress root directory. You can edit the file using ftp-client or control panel’s file manager.

Find the one of the following lines from php-config.php.

define('WP_DEBUG', true);
define('WP_DEBUG', false);

In either case, replace the line above with the following code, and PHP errors disappear from WordPress pages. However, errors are still visible at php logs, but those are not visible for visitors, so everything looks normal. Now you have time to fix the root cause or ask your developer take a look on the issue.

ini_set('display_errors','Off');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false);
5/5 - (1 vote)
See also  What are the most common types of web attacks against websites

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.