How do i hide php warnings and notices in wordpress?

Skip to content

How do i hide php warnings and notices in wordpress?

AitThemes

Block-based WordPress Theme

PHP Warnings and PHP Notices can come from various plugins and might fill up your error log. You can turn them off in your wp-config.php file with these settings:

ini_set('display_errors','Off');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false);

Post navigation

Rating: 5.0/5. From 3 votes.

Please wait...

This tutorial will show you how to hide PHP warnings and notices in WordPress.

WordPress. How to hide PHP warnings and notices

For example this warning at the frontend:

How do i hide php warnings and notices in wordpress?

  1. Log into the Host Control Panel (Cpanel). Go to File Manager (or you can connect to FTP):

    How do i hide php warnings and notices in wordpress?

    Get to the root directory of the website, open wp-config.php file:

    How do i hide php warnings and notices in wordpress?

  2. In this file, we will search for:

     define('WP_DEBUG', false);
    

    How do i hide php warnings and notices in wordpress?

    We will replace this piece of codes with:

    ini_set('log_errors','On');
    ini_set('display_errors','Off');
    ini_set('error_reporting', E_ALL );
    define('WP_DEBUG', false);
    define('WP_DEBUG_LOG', true);
    define('WP_DEBUG_DISPLAY', false);
    

    How do i hide php warnings and notices in wordpress?

    Save the file.

Refresh the page to check the result.

Feel free to check the detailed video tutorial below:

WordPress. How to hide PHP warnings and notices

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket

How do I turn off PHP warnings in WordPress?

Either way, you're looking for the “WP_DEBUG” portion of the wp-config. php file. Click the “Save Changes” button in the top right. Once the file is saved, this will disable the PHP warnings in WordPress.

How do I hide warnings and notices in PHP?

In the current file, search for the line of code error_reporting. There will be a line of Default Value: E_ALL as shown below: Replace this line of code with Default Value: E_ALL & ~E_NOTICE. It will display all the errors except for the notices.

How do I turn off notices in WordPress?

Installation.
Press the Add New button on your WordPress Dashboard Plugins screen..
Search for “Hide Admin Notices”.
Press Install Now and then Activate..
The plugin will work straight away; there is nothing more to do!.

How do I turn off PHP errors?

To turn off or disable error reporting in PHP, set the value to zero. For example, use the code snippet: