Blog

We are a team of results-driven creative geniuses at PMGS Digital Agency that are enthusiastic about expanding your business and have the skills to do it.

Homeblogturn-off-php-errors-wordpress

How to turn off PHP errors in WordPress

How to turn off PHP errors in WordPress

One of our readers recently inquired about how to disable PHP errors in WordPress. PHP warnings and alerts assist developers in troubleshooting their code. However, when they are exposed to all website visitors, it appears incredibly unprofessional. This tutorial will demonstrate how to simply disable PHP errors in WordPress.

PHP errors on your WordPress site are often warnings and alerts. This is not the same as an internal server error, syntax problems, or fatal errors, which prevent your website from loading.

Notices and cautions are error messages that do not prevent WordPress from loading your website.

php error warnings

These errors are intended to assist developers in debugging difficulties with their code. This information is required by plugin and theme authors in order to verify for compatibility and best practises.

If you are not creating a theme, plugin, or custom website, these errors should be hidden. Because they seem incredibly unprofessional if they display on the front end of your website to all of your visitors.

error-frontend

If you see an error like the one shown above on your site, you should contact the theme or plugin provider. They may release a fix that eliminates the error. Meanwhile, you can disable these errors.

Let’s see how to simply disable PHP errors, notifications, and warnings in WordPress.

Disabling PHP Errors in WordPress

You will need to make changes to the wp-config.php file for this step.

Look for the following code in your wp-config.php file:

wp-config

It’s also conceivable that this line has previously been set to false. In that situation, the following code will appear:

wp-config

In any instance, you must substitute the following code for this line:

wp-config

Remember to save your modifications and re-upload your wp-config.php file to the server.

You may now browse your website to ensure that the PHP problems, alerts, and warnings have vanished.

Activating PHP Errors in WordPress

If you are developing a website on a local server or staging area, you should enable error reporting. In such scenario, modify your wp-config.php file and replace the code you previously added with the following:

wp-config

This code will enable WordPress to display PHP errors, warnings, and alerts once again.

We hope this tutorial has shown you how to disable php errors in WordPress.

If you think this article was useful to you, then stay tuned with us and subscribe to receive our blogs. If you wish to stay connected with us on social media, you can find us on Facebook, Instagram and LinkedIn