Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk3 min

How to Enable WordPress Debugging and Troubleshoot Errors Safely

Use WP_DEBUG, WP_DEBUG_LOG, and WP_DEBUG_DISPLAY to capture WordPress PHP errors in a log without exposing them on your pages.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To log WordPress errors without showing them to visitors, add three settings to wp-config.php: enable WP_DEBUG and WP_DEBUG_LOG, and set WP_DEBUG_DISPLAY to false. Reproduce the problem, then inspect the resulting log. On a live site, keep error display off and protect the log; WordPress recommends using debug tools on local or staging sites rather than live sites.

Enable WordPress debug logging

Back up your site or make the change on a staging copy first. Open the WordPress installation’s wp-config.php and add the following lines before /* That's all, stop editing! Happy blogging. */:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

With this configuration, WordPress writes PHP errors to wp-content/debug.log by default and does not print them into page output. WP_DEBUG_LOG and WP_DEBUG_DISPLAY only take effect when WP_DEBUG is enabled. See the WordPress Developer Resources debugging guide and Learn WordPress debugging-log tutorial.

Development or staging

Use debug mode on a local or staging installation when possible. The WordPress Developer Resources guide says: “It is not recommended to use WP_DEBUG or the other debug tools on live sites; they are meant for local testing and staging installs.”

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Live site

If you must investigate a production problem, keep WP_DEBUG_DISPLAY set to false so diagnostic messages do not appear to visitors. The default log is inside wp-content, which may be web-accessible depending on server configuration. Where possible, set WP_DEBUG_LOG to a valid custom file path outside the public web root. If you cannot do that, restrict access to the log and its file permissions. Error logs can contain sensitive details, so do not publish or share them publicly.

Reproduce the error and read the log

  1. Save the configuration change, then repeat the action that triggers the blank page, PHP error, or plugin/theme failure.
  2. Open the configured log file, usually wp-content/debug.log, and inspect the newest entries related to the time of the failure.
  3. Look at the error message, file path, and any stack context. A path pointing into a plugin or theme can help identify the component involved; a WordPress core path may indicate a core-level issue or an interaction. Treat the log as diagnostic evidence, not proof by itself.
  4. Do not share raw log contents publicly. Redact sensitive paths or other identifying details before sending relevant excerpts to a trusted host or developer.

The WordPress debug log records server-side PHP errors; it will not diagnose a browser-side JavaScript problem. For JavaScript failures, use the browser’s developer tools and inspect the console.

If the dashboard is inaccessible

A fatal PHP error can prevent you from reaching the WordPress dashboard. WordPress Recovery Mode may send an email to the site administrator with a special login link, allowing access to address the component identified as causing the fatal error. Check the administrator email account, including spam folders. The official WordPress troubleshooting FAQ also advises contacting your host if recovery is not available. If you have file access, temporarily renaming the suspected plugin’s directory can deactivate it; restore the directory name after the issue is resolved or you are ready to troubleshoot further.

When the log is missing or empty

  • Confirm that WP_DEBUG is set to true and that the settings appear before the “That’s all, stop editing!” comment.
  • Check that the configured log path is valid and that the server can write to it.
  • Reproduce the error again after enabling logging; an old log may not contain the current failure.
  • Ask your host where the PHP or server error logs are kept. Their location depends on the hosting environment, so there is no universal path.

The WordPress debugging guide describes the debug constants and other debugging approaches. Hosting support may also help with fatal errors or finding server logs; WordPress’s hosting FAQ discusses hosting features and professional support.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Other WordPress debugging settings

For developers investigating specific issues, SCRIPT_DEBUG loads development versions of WordPress core CSS and JavaScript assets, which is useful when modifying those files. SAVEQUERIES records database queries for inspection but carries a performance cost. Do not leave diagnostic settings enabled on a live site after the investigation. The official debugging guide also covers plugins, automated tests, and step debugging. Xdebug and Ray are optional third-party tools for more advanced PHP debugging; they are not required for the basic logging procedure.

Turn debugging off after troubleshooting

  1. Once the underlying fault is fixed, return to wp-config.php and disable debug mode by setting WP_DEBUG to false or removing the temporary debug constants.
  2. Remove the diagnostic log or secure and rotate it if it must be retained.
  3. Test the site again to confirm the fix and check that diagnostic messages are not visible on public pages.

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.

Leave a Reply

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

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.