Recommended Free Tools
To stop PHP errors appearing on a live WordPress site, edit wp-config.php and set the debug constants to the boolean false, while explicitly disabling PHP display_errors. Put the definitions above the “That’s all, stop editing!” line. If you need to investigate a fault, keep errors hidden and enable logging temporarily instead of displaying them to visitors.
Disable PHP errors on public pages
Use your host’s file manager, SFTP, or another supported file-access method to open the active site’s wp-config.php. Add or edit these lines before WordPress loads (normally above the “That’s all, stop editing!” line):
@ini_set( 'log_errors', 'On' );
@ini_set( 'display_errors', 'Off' );
define( 'WP_DEBUG', false );
define( 'WP_DEBUG_LOG', false );
define( 'WP_DEBUG_DISPLAY', false );
This production pattern asks PHP not to print errors and leaves PHP’s logging facility available, while WordPress debug mode, its display output, and its debug log are disabled. Do not add a second definition if the file already contains one; edit the existing line instead.
Use real PHP booleans
Write false without quotation marks. The value 'false' is a non-empty PHP string and is therefore truthy, so it does not turn debugging off. The same rule applies to true.
#1 Best Overall
Why both WordPress and PHP settings matter
WP_DEBUG_DISPLAY controls WordPress debug messages when WP_DEBUG is active. PHP’s own display_errors directive can still affect output, so explicitly setting it to Off (or 0) is important. A hosting policy may override either setting.
Hide errors while you troubleshoot
If an error needs investigation, record it privately without putting the details in page HTML. Temporarily use:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
WordPress then records debug output in wp-content/debug.log by default while keeping it out of the response sent to visitors. WP_DEBUG_LOG can also be a valid custom file path if your setup supports one.
- Back up
wp-config.phpbefore changing it. - Apply the diagnostic settings and reproduce the problem privately.
- Read the log through a protected administrative or server-access method; never publish its contents.
- Fix the plugin, theme, configuration, or code identified by the log.
- Return to the production settings, then remove the temporary log or move it outside the public web root.
Debug mode is intended for development and staging. Do not turn visible errors on for a public site merely to obtain a diagnosis.
Protect the debug log
A log can contain file paths, configuration details, database-related information, usernames, request data, or other sensitive values. The default wp-content/debug.log location may be web-accessible depending on server rules. Restrict access to it, store logs outside the public document root when possible, and delete temporary logs after troubleshooting.
When wp-config.php does not change the output
The PHP handler or server may control display_errors and refuse or override an in-file ini_set(). First confirm that you edited the active site’s configuration and that there are no duplicate constant definitions. Then identify whether the site uses Apache’s PHP module, FastCGI/PHP-FPM, or a host-managed setup.
Rank #4
Apache PHP module
Where the host permits PHP directives in .htaccess, an Apache-module configuration can use:
<IfModule mod_php8.c>
php_flag display_errors off
</IfModule>
The module name and whether this directive is permitted vary by server. Do not add this example to a FastCGI/PHP-FPM site unless your host specifically supports it.
Best Value
FastCGI or PHP-FPM
Some hosts allow a .user.ini file containing:
display_errors = 0
PHP-FPM implementations differ in where user-level settings are accepted and how quickly they are reloaded. Follow the host’s documented method rather than assuming this file will be read.
Managed hosting controls
Many providers expose PHP error display in a hosting control panel or lock the directive at the server level. Check the panel’s PHP or error-handling settings. If the site is down, the WordPress log is unavailable, or the setting remains unchanged, ask the provider where its server-level error log is stored and request that public error display be disabled.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Common mistakes to avoid
- Do not use
define( 'WP_DEBUG', 'false' );; quoted values are strings, not booleans. - Do not define
WP_DEBUG,WP_DEBUG_DISPLAY, orWP_DEBUG_LOGtwice; the first definition can remain in force and produce confusing results. - Do not assume
WP_DEBUG_DISPLAYalone overrides PHP’sdisplay_errorsdirective. - Do not treat
WP_DEBUG_DISPLAYorWP_DEBUG_LOGas independent switches: they operate in conjunction withWP_DEBUG. - Do not leave debugging or an unprotected
debug.logenabled after the investigation.
Choose the setting for your situation
| Goal | WP_DEBUG | WP_DEBUG_DISPLAY | WP_DEBUG_LOG | PHP display_errors |
|---|---|---|---|---|
| Normal production operation | false |
false |
false |
Off or 0 |
| Temporary diagnosis without exposing errors | true |
false |
true |
Off or 0 |
| Visible errors on a public site | Not recommended | Not recommended | Not recommended | Not recommended |
The key distinction is visibility versus recording: keep visibility off for visitors, and enable recording only for the limited period needed to diagnose a problem.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →




