How to Stop WordPress From Displaying PHP Errors Using cPanel

The most common practice of troubleshooting of a WordPress website is to enable debugging, which displays PHP errors on a website.

You can even see the syntax errors inside your wp-admin area. It can be frustrating for a non-techie person. And some errors don’t affect the website, so you don’t need to keep the debugging enabled.

In such a situation, you should stop WordPress from displaying PHP errors. As you already know, WordPress is a PHP-based platform, and its plugins and themes also consist PHP, to debug anything, developers use the advanced features.

But when you’re trying to solve the errors related to the server, 404 error, 403 forbidden error, etc. You don’t need to see PHP errors.

In this tutorial, you’re going to learn about disabling debugging from cPanel of your web hosting. You can also edit the wp-config.php file from your WordPress dashboard, but for security reasons, most of the companies disable file editing.

So, you’ll need to learn the cPanel method.

Learn the Importance of wp-config.php

Now and then, you may encounter with an article explaining the process to accomplish a task using wp-config.php, it’s not an ordinary file, it controls more than just the connection between a website and its database.

If you have ever noticed, the file consists of the SALT Keys and many other codes, which play an essential role in managing your WordPress site.

Today, you need to learn about the convenient way to edit the wp-config.php file. You can either use an FTP server or directly access it from cPanel.

I would recommend the cPanel method. Follow the steps.

Step 1:

Open your cPanel account offered by your web hosting company and try to search the file manager.

Depending on the company you use, the layout may be different.

How to Stop WordPress From Displaying PHP Errors Using cPanel

You might also see the file manager icon in the different section. There is nothing to worry about; you can easily find it.

Some people get confused because of the different cPanel design. Well, don’t be. Options are all similar.

Step 2:

On this new page, you can see many files and folder, but

You have to check if you’re in the public_html directory
, if not, click on it from the left-hand sidebar.

How to Stop WordPress From Displaying PHP Errors Using cPanel

By default, you may see the home directory, so you need to navigate.

Step 3:

Search for the wp-config.php file and right-click to edit.

Finding a file isn’t so hard.

How to Stop WordPress From Displaying PHP Errors Using cPanel

If you have multiple websites running on the same server, you need to open the root directory of the website you want to work on, mostly, it’s the folder with the name of a domain.

Step 4:

You can see a dialog box to disable encoding.

Click on the Edit button to proceed.

How to Stop WordPress From Displaying PHP Errors Using cPanel

Step 5:

A new tab opens up on your browser, and you can see all the coding available inside the wp-config.php file. Here, you need to find

“WP_DEBUG.

As your website already shows PHP errors, the code is as follow.

define('WP_DEBUG', true);

The code mentioned above enables the PHP errors to display on your site, but you need to disable them. So, replace it with a new code.

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

Click on the Save Changes button from the top-right corner, and you’re all set. Now, if you clear your browser cache and check your website, you don’t see any PHP error message.

Congrats, you have successfully disabled PHP errors from displaying on your WordPress site.

I Hope You Don’t Face Any Difficulty in Disabling PHP Errors

Every time I create a new tutorial, I feel like achieving something. If you follow the steps with screenshots, you can accomplish your goal.

I remember when I freaked out after seeing so many coding lines on my website’s dashboard. I didn’t know such a trick that time, but I do, now.

Conclusion

You don’t need to worry whether you have coding skills or not. All you need is copy and paste the code inside the wp-config.php file.

As I have mentioned, you have to find the debug code and replace it with a new code. There is nothing complicated. I hope you don’t find anything brainstorming.

Check out these top 3 WordPress hosting services:

HostArmada
$2.49 /mo
Starting price
Visit HostArmada
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.5
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.0
IONOS
$1.00 /mo
Starting price
Visit IONOS
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.0
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.3
Ultahost
$2.90 /mo
Starting price
Visit Ultahost
Rating based on expert review
  • User Friendly
    4.3
  • Support
    4.8
  • Features
    4.5
  • Reliability
    4.0
  • Pricing
    4.8

How to Enable Error Reporting Using the php.ini File Using cPanel

This how-to guide explains the essential steps while troubleshooting and how you
3 min read
Arvind Singh
Arvind Singh
Hosting Expert

How to Fix Destination Folder Already Exists Error of a WordPress Website Using cPanel

This how-to guide explains the causes and their solutions of "Destination Folder
2 min read
Arvind Singh
Arvind Singh
Hosting Expert

How to Solve "Maximum Execution Time Exceeded" Error of a WordPress Website

This how-to guide provides the solution to fix Maximum Execution Time Exceeded e
3 min read
Arvind Singh
Arvind Singh
Hosting Expert

How to Fix Image Upload Issue of Your WordPress Website Using FTP

This how-to guide explains the cause and solution of image upload error for a Wo
3 min read
Arvind Singh
Arvind Singh
Hosting Expert
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top