By using our mini forum, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy

Q: How to hide WordPress PHP errors?

+3 votes

Hi, I have a WordPress site and because it is old (very old!) how can I hide PHP errors?

For example here are some of the errors:

  • The submenus are not showing because of some Walker class.
  • The styles are gone! Instead of showing Areal as a font a Times New Roman is displayed.

Here are the errors I am getting (btw - I cannot get into the admin dashboard because of them!):

Warning: Declaration of New_Walker_Category::start_el(&$output, $category, $depth, $args) should be compatible with Walker_Category::start_el(&$output, $category, $depth = 0, $args = Array, $id = 0) in /home/vipozico/ on line 119
Warning: Declaration of DropDown_Nav_Menu::start_lvl(&$output, $depth) should be compatible with Walker_Nav_Menu::start_lvl(&$output, $depth = 0, $args = NULL) in /home/vipozico/ on line 119
Warning: Declaration of DropDown_Nav_Menu::end_lvl(&$output, $depth) should be compatible with Walker_Nav_Menu::end_lvl(&$output, $depth = 0, $args = NULL) in /home/vipozico/ on line 130
Warning: Declaration of DropDown_Nav_Menu::start_el(&$output, $item, $depth, $args) should be compatible with Walker_Nav_Menu::start_el(&$output, $item, $depth = 0, $args = NULL, $id = 0) in /home/vipozico/ on line 144
Warning: Declaration of DropDown_Nav_Menu::end_el(&$output, $item, $depth) should be compatible with Walker_Nav_Menu::end_el(&$output, $item, $depth = 0, $args = NULL) in /home/vipozico/ on line 181
Warning: Declaration of TGM_Bulk_Installer_Skin::before() should be compatible with Bulk_Upgrader_Skin::before($title = '') in /home/vipozico/ on line 1977
Warning: Declaration of TGM_Bulk_Installer_Skin::after() should be compatible with Bulk_Upgrader_Skin::after($title = '') in /home/vipozico/ on line 1999
Warning: Cannot modify header information - headers already sent by (output started at /home/vipozico/ in /home/vipozico/ on line 244
Warning: Cannot modify header information - headers already sent by (output started at /home/vipozico/ in /home/vipozico/ on line 1329
Warning: Cannot modify header information - headers already sent by (output started at /home/vipozico/ in /home/vipozico/ on line 1332

I know that in the wp-config.php in the root of the site there is a line of code:

define('WP_DEBUG', false);

but how can I edit it?


asked in Web Development category by user richard8502
retagged by user golearnweb

2 Answers

+2 votes

To totally hide the PHP errors in wp-config.php you must replace:

define('WP_DEBUG', false);


ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false);
answered by user eiorgert
edited by user golearnweb
+1 vote

You can also debug the errors in your WordPress system;

For this purpose, you can add these line of code in wp-config.php:


define('WP_DEBUG', false);

WITH (you can also read the comments in the code):

define('WP_DEBUG', true);
//Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);
//false == Showing errors ONLY in /wp-content/debug.log file NOT in the site
define('WP_DEBUG_DISPLAY', true);

You can also watch this useful video about debugging WordPress sites:

Or you can use some debugging WP plugins: read more here


answered by user tuto
edited by user golearnweb