How To Turn Off PHP Errors In WordPress
How To Turn Off PHP Errors In WordPress

There is a great built-in method in WordPress for debugging which works for various developers. It automatically brings up a warning message which continues to detail which file is faulty and which line you need to look at. But, there are times where if you look at it from a viewer’s perspective, it would look horrible. The WordPress popup could possibly discourage a lot of visitors from returning to the site.

It’s not that much of a complicated process when it comes to the process of turning off the PHP errors in your WordPress site. It’s an easy bit of code and all you have to do is copy and paste it in your site. 

You can also watch the video tutorial:

In case you require more help when it comes to turning off the PHP errors, our team is ever ready to help correct your issues. 

What is the cause of the PHP messages?

Most of the time, the line warnings in PHP files are due to the outdated theme or plugins. As the WordPress updates move further, the core files change along with it, which ends up making a few parts of code obsolete.

When themes and plugins are used with something that isn’t actually compatible, the PHP warning messages would popup. There is also the possibility that two plugins could work perfectly fine separately but when it comes together, they may have issues. This is due to the fact that each developer is not the same, and not every one of them use the exact same syntax while they develop the site files. 

Thankfully, when these php error messages popup, it doesn’t necessarily mean that the site is messed up in any way. It just doesn’t look that good from a viewer’s perspective. There may be times when the developer could possibly create an update so that they could fix the warning, but this process may not exactly be the fastest. 

PHP Warnings in WordPress look something like:

“/wp-content/plugins/siteplugin.php on line 30”

But, this doesn’t automatically declare that the plugin is horrible. It only says that the part of the file is incompatible with your WordPress site. 

Until and unless you actually plan to fix the code on your own, it’s suggested that it’s a better idea to simply disable the warning messages altogether. In case of the chance that the tool is not completely unusable or destroyed, the warning may not be applied to you in the same way. 

How to switch off PHP errors in your WordPress site?

Now, the following steps all include editing the wp-config.php file in WordPress. So, it’s a strong suggestion that you create a backup of your website before you create coding changes. This would save your site in case something goes downwards by giving you a simple and easy method to restore your website. 

There are a lot of ways which are available for accessing the wp-config.php file in WordPress.

But, I’m going to use the File Manager in CPanel. 

How To Turn Off PHP Errors In WordPress
  • First, go and access your WordPress site by just tapping the “public_html” folder in the directory.
How To Turn Off PHP Errors In WordPress

  • Then, go and click on the wp-config.php file and click, “Edit.” It’s displayed right on the top toolbar of the File Manager. 
  • Now, you have to tap on the “Edit” button on the new window. This text means that it gives you the permission to make changes in the character encoding of the editor. There is no need as such to make changes in the same section. 
  • When you further scroll down, you’ll see that the line has this code:
How To Turn Off PHP Errors In WordPress
[ht_message mstyle=”info” title=”” show_icon=”” id=”” class=”” style=”” ]define(‘WP_DEBUG’, false);[/ht_message]
How To Turn Off PHP Errors In WordPress
  • You are most likely to see ‘true’ instead of ‘false’, so you have to replace it and type in ‘False’. 
  • Now, you should go and tap on Save Changes. 
  • Once you’re done saving it, you can go back to your dashboard and refresh it. 
  • You’ll notice that there used to be PHP related errors which are no longer visible now. 

As long as you follow the steps mentioned above correctly, you’ll achieve the solution to your problem. 

In case you require more assistance, or have more queries or doubts, feel free to contact us or check out our website Digital Suncity. 

Also Read: How To Disable Deactivation Plugin From WordPress Admin Panel

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Need Professional Help?

We can help you with website fixes and ongoing maintenance.