• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

WP Thinker

The WordPress Playground

  • Snippets
  • Best
  • Guides
  • Reviews
Home / Guides

October 19, 2020 Milan

How to Turn Off PHP Errors in WordPress

PHP-Error-in-WordPress

PHP errors, warnings, and notices have their use – to help you deduct what the problem is, obviously. Then, you’ll know exactly whether it was a wrong syntax, or you need to install a WordPress plugin or even delete an entire theme in WordPress and start anew. Two great examples of that are WordPress white screen of death and the “This site is experiencing technical difficulties” error. Now that you realize its importance, it’s also evident that you don’t need its help all the time. Luckily, there’s a way to enable or disable the feature at will. Here’s how to turn off PHP errors in WordPress.

The easiest way to disable PHP errors

You’ll need to access your WordPress files via FTP. To do this, you have two options. Both yield identical results, so you’re free to choose.

  1. Download and install an FTP client software.
    Then, use the login details provided by your hosting (hostname or IP address, password, port, protocol) to access the root folder.
  2. Log in to your cPanel on your hosting website.
    Look for an option called FTP, File Manager, or Files.

Then, do this:

  1. Find your WordPress website’s root folder.
    It might also be called www, public_html, or have your domain name.
  2. Find a file named wp-config.php.
  3. Find the Edit option somewhere in the cPanel or FTP client.
  4. The file will open like any other text file.
  5. Press Ctrl (Control) + F on your keyboard.
  6. Search for ‘wp-debug.’
  7. Since PHP errors are enabled, you should find a line like this:
    define(‘WP_DEBUG’, true);
    Tip:
    You’ll know you’re in the right place because there will be a line /* That’s all, stop editing! Happy blogging. */ below.
  8. Simply change true to false, so that it looks like this:
    define(‘WP_DEBUG’, false);
  9. Find the Save or Save Changes option in your software or the cPanel and press it.
  10. Refresh your website’s homepage, or the page you noticed errors on.
  11. Fixed? Great job!

What if it doesn’t work?

If this didn’t fix the issue, do this.

  1. Go back to the same line.
  2. Then, highlight the line and replace it with this:
    ini_set(‘display_errors’, 0);
    ini_set(‘error_reporting’, E_ALL );
    define(‘WP_DEBUG’, false);
    define(‘WP_DEBUG_DISPLAY’, false);
  3. Once again, Save Changes.
  4. The PHP errors shouldn’t be there anymore.

That’s it! Making PHP errors disappear from WordPress wasn’t so hard, was it? If you need to enable them in the future, install a developer addon such as Query Monitor, for example.

Milan

A WordPress lover and blogger. Have been writing about WordPress for the past few years and loves sharing his knowledge and findings to those who need help.

Primary Sidebar

Related Articles

Footer

WP Thinker is a website that publishes everything related to WordPress, Plugins, Themes, SEO, Blogging, etc.

  • Facebook
  • Twitter
  • Pinterest

Copyright © 2023 · WP Thinker

  • About Us
  • Advertise
  • Write for Us
  • Privacy Policy
  • Terms and Conditions
  • Contact Us
This website uses cookies to serve you better. By continuing to use this website, you agree to our cookie and Privacy Policy.