Site icon AWS: © LimitlessV, Software Development Solutions.

How to hide PHP Warnings and Notices in WordPress

Last week one of our WordPress clients install 3rd party theme and call for support. The client says, “I getting PHP notices and warnings on my page.”

In most cases, these are nothing to worry about as the plugin or theme developer should solve it quickly. 

But when they appear on productions site, it could be a bit challenging and a honey pot for hackers to try and play with the website.

Some of these warnings generate as a result of the theme or plugin developers keeping compatibility with an older version of WordPress as well as older PHP versions.

The resolution:

The resolution for these cases is straightforward.

Open to edit the wp-config.php file.

find 

define('WP_DEBUG', false);

or if you don’t find it add it before the line:

/* That's all, stop editing! Happy publishing. */ ini_set('display_errors','Off'); ini_set('error_reporting', E_ALL ); define('WP_DEBUG', false); define('WP_DEBUG_DISPLAY', false);

These changes don't affect your site in any way. But will hide any error or warning message to appear.

I hope that helps someone out there!

Exit mobile version