WordPress - How to hide PHP Warnings and Notices in WordPress

WordPress - How to hide PHP Warnings and Notices in WordPress

PHP warnings and notices are not like internal server error, syntax errors, or fatal errors, which stop your website from loading.
They are nothing to worry about on a production site most of the time.
Though the plugin/theme developer should know about these so that they may fix them in a future release.

From this article, you’ll learn how to disable PHP warning or notice.

You need to edit the wp-config.php file.

Access the wp-config.php file

For accessing the wp-config.php file, you can use one of the below ways:

1. Enter your hosting control panel.

2. Through the FTP file manager.

3. Install and activate the File manager plugin

Steps to Disable PHP Warning or notice

1. Navigate to the WordPress root folder.

2. Find the wp-config.php file.

3. Click on Edit, or download it to your personal computer.

4. Inside your wp-config.php file, look for the following code:

  1. define('WP_DEBUG', true);

Or the following code:

  1.  define('WP_DEBUG', false);

5. Replace it with the following code:

  1. ini_set('display_errors','Off');
  2. ini_set('error_reporting', E_ALL );
  3. define('WP_DEBUG', false);
  4. define('WP_DEBUG_DISPLAY', false);

Save the changes and clear the browser cache to check it.

    • Related Articles

    • WordPress - How to Disable Comments

      In this article, we will explain how to disable comments on the whole website. 1. Navigate to the WordPress dashboard >> plugins >> Add new 2. Install and activate the file manager plugin  3. Open file manager plugin from WordPress dashboard. ...
    • WordPress - Increasing WordPress memory limit

      If you want to increase the WordPress memory limit, you can use one of the following methods: 1. Increasing memory limit through "wp-config.php": Please go to the root directory of WordPress and open "wp-config.php". Then find the line that has ...
    • Massive Dynamic - Remove the Division by zero warning

      In this article, we will explain how to remove the Division by zero warning. Install and activate "Visual Composer" plugin from WordPress dashboard >> appearance >> install plugins Open the page which has that warning in edit mode. Press the "Classic ...
    • WordPress - Revisions

      In this article, we will show how to use revisions on WordPress. Revision is a feature that allows you to undo changes and go back to an earlier version of a post or a page. For using this feature follow these steps: 1. Login to the Wordpress ...
    • Infinity Tool - hide the layers

      In this article, we'll explain how to hide or remove the element. Hide The Layer 1. Import the Infinity item which you want into the project. 2. From the layer panel, press the shy icon to see all the layers. 3. Find the layer of the element which ...