How to turn off PHP errors in WordPress Website? – Best of 2024

How-to-turn-off-PHP-errors-in-WordPress-Website

Do you want to know How to Turn off PHP Errors in WordPress? Read this article carefully, Firstly you know how PHP Errors occur. PHP error is critical to operate a healthy, secure and well-performing website if you do close monitoring of your site’s.

It may be occur unreliable and involuntary. It can be triggered by to do some changes to your server configuration, database setup or WordPress files. PHP notice and warning help the developers to debug problem with their code.

However it looks extraordinarily unprofessional when they are visible to all your website visitor. In this article we will show the the best way how to turn off PHP errors in WordPress.

Read Also: How to turn off or Disable Comments in WordPress Pages

When and Why You Should Turn Off PHP Errors in WordPress?

PHP errors that you see on your WordPress site are commonly warnings and notices. It is not like an internal server error or fatal error ( See our guide: How to fix fatal error in WordPress ) which stop your website from loading. Notice and warning are the kind of error which don’t stop WordPress from loading your website.

phperrorwarnings

These errors helps the developer debug issue with their code. With the help of plugin and theme developer need this information to check for compatibility and best practices. Plugin is defined as a type of software that contains a group of functions that can be added to a WordPress website. They are used to provide additional functionality to your application.

These errors should be hidden if you not developing a theme, plugin or custom website. Theme is a group of stylesheets and templates that are used to describe the appearance and display of a WordPress site. Templates are those files which control how your WordPress site will be displayed on the web.

If they were appear on the front-end of your website it looks extremely unprofessional.

Let’s see how to turn off PHP errors in WordPress:-

Turning off PHP Errors in WordPress

  • In this part you will edit the wp-config.php file. In this file you look the following line:

define(‘WP_DEBUG’, true);

  • This line is already set to false. In this case you will see the following code:

              define(‘WP_DEBUG’, false);

  • In other case, you can replace this line with the following code:
ini_set(‘display_errors’,’Off’);

 

ini_set(‘error_reporting’, E_ALL );

define(‘WP_DEBUG’, false);

define(‘WP_DEBUG_DISPLAY’, false);

  • To save your changes and uploading your wp-config.php file back to the server.
  • You can visit your website to validate that the PHP errors, notices and warning have disappeared from your website.

Turning on PHP Errors in WordPress

When you want to turn on error reporting, then you are working on a website on the local server or staging area. In this case can edit your wp-config.php file and replace the code you can be added earlier with the following code:

define(‘WP_DEBUG’, true);

define(‘WP_DEBUG_DISPLAY’, true);

This code allow WordPress to start display PHP errors, warning and notice again.

We hope that this article helped you in turn off PHP errors in WordPress. You can also contact to our WordPress Technical Support Number if you are facing any issue related to WordPress, dial +1-888-738-0846 (Toll-Free). 



Leave a Reply