To debug a WordPress failure without exposing it to visitors, edit wp-config.php and add WP_DEBUG, WP_DEBUG_LOG, and WP_DEBUG_DISPLAY before the stop-editing line. The safest diagnostic combination for a site that people can visit is:
Antihost offers managed WordPress hosting with free migration, one-click staging and a 14-day free trial.
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
Reproduce the problem, then inspect the newest entries in wp-content/debug.log (or the custom path you configured). Start with the first plugin, theme, file, function, and line named in the trace. Confirm the cause on staging, repair the component, and turn debugging off when finished.
As an Amazon Associate I earn from qualifying purchases.
Recommended Free Tools
What each WordPress debug setting actually does
WP_DEBUG is the master switch. WordPress raises PHP error reporting to E_ALL when it is enabled, allowing notices, warnings, deprecations, and fatal errors to be captured. The other two constants have no effect unless this switch is true.
| Setting | Purpose | Normal diagnostic value | Important limitation |
|---|---|---|---|
WP_DEBUG |
Turns on WordPress debugging and broad PHP error reporting. | true while investigating on development or staging. |
Do not leave it enabled on a public production site after diagnosis. |
WP_DEBUG_LOG |
Writes errors, warnings, notices, deprecations, and messages sent through PHP error_log() to a file. |
true for the default wp-content/debug.log, or a valid file path. |
It does nothing when WP_DEBUG is false. |
WP_DEBUG_DISPLAY |
Controls whether messages are inserted into generated HTML. | false when visitors must not see diagnostic output. |
It does nothing when WP_DEBUG is false; PHP display settings can also affect output. |
display_errors |
PHP-level switch that can print errors directly in the response. | Set to 0 while collecting logs on a live-facing site. |
It is separate from the WordPress constants, so disable both layers. |
Use real PHP booleans. Write true and false without quotation marks. A value such as 'false' is a non-empty string, which PHP treats as truthy and can produce the opposite behavior from what you intended.
#1 Best Overall
- BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
- EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
- COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
- LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
- WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.
Choose the right environment before editing configuration
Debugging changes the way PHP reports problems and can create a file containing paths, queries, request data, and stack traces. A local copy or staging site is the preferred place to trigger failures. If the problem exists only on production, take a backup and use the least revealing settings: log to a protected location, keep display output disabled, reproduce once, and remove the diagnostic material immediately afterward.
Back up the files and database
Save a known-good copy of wp-config.php before changing it. A syntax mistake in this file can prevent WordPress from loading. A current database and file backup gives you a recovery path if a plugin, theme, or configuration change causes a second failure.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteUse an authenticated way to inspect files
Plan how you will read the log before enabling it. SSH, SFTP, or a hosting control-panel file manager are appropriate authenticated methods. Do not assume that a browser should be able to open debug.log; a web-accessible log can disclose information to anyone who finds its URL.
Enable WP_DEBUG and file logging
Open the WordPress root directory and edit wp-config.php. Insert the following block before the line that says /* That's all, stop editing! Happy blogging. */:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
- Save the file without changing its PHP opening tag or adding characters before it.
- Load the site once to check that WordPress still responds.
- Trigger the specific failure instead of clicking around randomly. Use the same page, form submission, Ajax action, REST request, or scheduled task that originally failed.
- Record the approximate time and request you made. This makes the corresponding log entries easier to identify.
With this configuration, WordPress records diagnostic messages but keeps them out of normal page HTML. The final ini_set() line explicitly turns off PHP’s direct error display, which is an additional safeguard when server-level settings would otherwise print messages.
Rank #2
- WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
- AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
- PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
- ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
- COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
Find the debug.log file or set a custom path
When WP_DEBUG_LOG is true, WordPress uses wp-content/debug.log by default. The path is relative to the WordPress installation, not necessarily the server’s document root. Multisite, relocated content directories, and unusual hosting layouts can therefore make the file appear somewhere other than the directory you first expect.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Use a custom file path
You may replace true with a valid path:
define( 'WP_DEBUG_LOG', '/protected/path/wordpress-debug.log' );
Use a location that the PHP process can write to and that the web server cannot serve as a public download. An absolute path outside the public document root is preferable when your host permits it. If the file never appears, check the directory’s ownership and permissions, available disk space, and the PHP user that runs the request. A path that looks valid to you may be unwritable to that process.
When no log is created
- Confirm that
WP_DEBUGis exactlytrue; the companion constants are inert without it. - Check that the edited
wp-config.phpis the one used by this installation. Some hosts place it one directory above the web root. - Verify that the configured directory exists and is writable by PHP.
- Look for a hosting-level PHP error log if WordPress cannot write its own file.
- Make a harmless test request after saving, then inspect the file’s modification time rather than relying on an old entry.
Reproduce the failure in a controlled way
A log is useful only when you can connect an entry to a request. Clear or archive an old log on staging, enable the settings, and perform one reproducible action at a time. For a front-end problem, load the exact URL and repeat the click that triggers it. For an editor problem, open the affected post type and perform the failing save. For an integration, send the same webhook or REST request with the same authentication and payload. For a background task, wait for the relevant WP-Cron event or run it through the site’s normal scheduler.
Include off-screen requests
Ajax calls, REST requests, and WP-Cron jobs often fail without placing an error in the HTML you can see. A blank Ajax response, a failed block-editor request, or a task that silently stops can still write a useful entry to the log. Note the request time, endpoint, user action, and—when available—the HTTP status shown by your browser’s network panel or task monitor.
Avoid changing several variables at once
Do not update a plugin, switch themes, edit PHP, and alter server settings in one pass. Each change destroys your ability to tell which component fixed or caused the problem. Capture the original error first, then make one controlled change and reproduce the same request.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Rank #3
- Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
- Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
- Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
- ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
- Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
Read the newest entries first
Open the log through SSH, SFTP, or your hosting file manager and start at the bottom, where the newest entries normally appear. For each relevant entry, record five details:
- Timestamp: match it to the request you just reproduced. Server and site time zones may differ.
- Severity: distinguish a
PHP Fatal errorfrom a warning, notice, deprecation, or informational message. - Message: identify the missing class, undefined function, type mismatch, database error, or other immediate symptom.
- File and line: note the exact PHP file and line reported by the engine.
- First application component in the trace: find the first plugin, theme, or custom-code function called in the stack, not merely the WordPress core function that eventually stopped.
The last line is not always the root cause. A plugin can pass invalid data into a core function, so the fatal line may be in core while the first application-specific caller identifies the component that supplied the bad value. Read upward through the trace until you find that boundary.
Interpret common severities
- Fatal error: execution stopped for that request. Look for an incompatible function, missing class, parse error, exhausted memory, or uncaught exception.
- Warning: execution may continue, but a file, value, or operation was not handled as expected. Repeated warnings can precede a later fatal error.
- Notice: code accessed something questionable, such as an undefined index. Notices may reveal a compatibility problem even when the page still loads.
- Deprecated: code uses an API that a current PHP or WordPress version plans to remove. Treat recurring deprecations as upgrade work, not harmless noise.
Read a cluster of entries around the same timestamp together. One underlying failure can produce several follow-on warnings; fixing the earliest meaningful application error is usually more productive than chasing every consequence.
Trace a critical error back to a plugin, theme, or custom code
Once you have the file, line, and first application function, map it to the request that failed. A file under a plugin directory points to that plugin’s code; a file under the active theme points to the theme or custom snippets; a file in a must-use plugin or hosting integration may not appear in the normal Plugins screen.
Confirm the suspect on staging
- Clone or restore the site to staging, preserving the same WordPress, PHP, plugin, theme, and database versions if possible.
- Enable logging there and reproduce the same request.
- Deactivate only the suspected plugin or switch temporarily to a bundled theme.
- Repeat the request and compare the new log.
- Reactivate or restore the component, then test the next suspect if the error remains.
Confirmation means the same failure disappears when one component is isolated and returns when that component is restored. If disabling a plugin merely hides the symptom, inspect dependencies, hooks, and the data passed into the failing function before declaring the cause solved.
Rank #4
- Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
- Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
- 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
- Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
- USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
Handle a locked-out administrator
If a fatal plugin or theme error prevents normal access, use your host’s file manager or database tools to deactivate the offending component, then restore access and investigate on staging. Renaming a plugin directory is a temporary emergency measure, not a repair; WordPress will treat the plugin as missing until the directory name is restored.
Understand Recovery Mode and fatal-error handling
WordPress 5.2 introduced Recovery Mode to intercept a fatal error from a plugin or theme and give an administrator a protected session in which to deactivate the failing component. It is designed to keep one extension failure from permanently locking every user out.
Recovery Mode can make a public failure appear less severe than it is because the administrator’s session receives a special recovery flow while ordinary visitors may see a generic error. Check the log and the recovery notice rather than assuming the issue has disappeared.
Free tools Windows power users keep installed
One-click scans. No signup required.
For development diagnosis, the WordPress configuration handbook documents:
define( 'WP_DISABLE_FATAL_ERROR_HANDLER', true );
This disables the fatal-error handler so the underlying fatal can remain visible to developers. Use it only in a controlled development environment while you need the complete failure. Do not add it casually to a public production site, where it can remove the protection Recovery Mode provides.
Best Value
- Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
- Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
- Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
- Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
- Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
Separate display debugging from log-only debugging
| Approach | What the requester sees | Where evidence goes | Best use | Main risk |
|---|---|---|---|---|
WP_DEBUG=true, WP_DEBUG_DISPLAY=true |
Messages may be printed in generated HTML. | Possibly the response, and a log if logging is enabled. | Local development when the developer controls the browser. | Paths, queries, credentials, and stack details can leak to visitors or be cached. |
WP_DEBUG=true, WP_DEBUG_LOG=true, WP_DEBUG_DISPLAY=false |
Normal pages stay free of diagnostic output. | wp-content/debug.log or the configured custom path. |
Staging and carefully controlled production diagnosis. | The file is sensitive and must be protected and removed after use. |
WP_DEBUG=false |
No WordPress debug output is enabled by these constants. | No WordPress debug log from this configuration. | Normal production operation after the issue is understood. | You lose the extra evidence if you turn it off before reproducing the problem. |
Even with WP_DEBUG_DISPLAY false, a server-level PHP configuration can print errors. Keep @ini_set( 'display_errors', 0 ); in the temporary diagnostic block when you need to guarantee that generated pages do not expose messages.
Investigate database, scripts, and deeper code paths
The basic log identifies many PHP failures, but not every WordPress problem is a single fatal line. Once the immediate cause is isolated, the official WordPress debugging workflow also includes specialized options:
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsSCRIPT_DEBUG: loads development versions of core JavaScript and CSS instead of minified assets, which helps when an editor or interface fails in the browser.SAVEQUERIES: records database queries and timing for query analysis. Enable it only in a controlled environment because it consumes memory and can expose query data.- Debugging plugins: can add request, hook, and query inspection, but treat their output as sensitive and remove them after diagnosis.
- Automated tests: reproduce a regression repeatedly without relying on manual clicks.
- Step debugging: a debugger can pause execution and inspect variables when a log line is too general to explain the bad input.
These tools complement, rather than replace, the first reproduction and log review. Add one diagnostic layer at a time so its output remains attributable to the request you are testing.
Production security and cleanup
Debug logs and visitor-visible errors can disclose absolute server paths, database structure, usernames, request payloads, plugin details, and values passed to third-party services. WordPress Site Health treats visitor-visible errors and potentially public logs as security risks for that reason.
While collecting diagnostics
- Keep
WP_DEBUG_DISPLAYfalse and PHPdisplay_errorsoff. - Use an authenticated file method to read the log.
- Prefer a non-public custom path when your host supports one.
- Limit the diagnostic window and avoid publishing screenshots that contain paths, tokens, or user data.
- Restrict access to staging and production administration accounts that need the evidence.
After the cause is understood
- Apply and test the repair on staging first.
- Deploy the smallest confirmed change to production.
- Set
WP_DEBUGtofalseand remove temporary overrides such asWP_DISABLE_FATAL_ERROR_HANDLER. - Remove or securely archive
debug.logand any custom log file. Do not leave old logs publicly reachable. - Repeat the original request and verify both that the feature works and that no new diagnostic output is exposed.
Do not simply truncate a log and leave debugging enabled indefinitely. A quiet day does not prove the configuration is safe; a later request can write sensitive data without anyone noticing.
Quick diagnosis table
| Symptom | First check | Likely next action |
|---|---|---|
| Visitors see PHP paths or warnings | WP_DEBUG_DISPLAY and display_errors. |
Set both display controls off, keep logging only if needed, and invalidate cached error pages. |
No wp-content/debug.log |
Master switch, edited config file, path permissions, and disk space. | Correct the path or permissions and reproduce a request. |
| Page loads but an Ajax action fails | Newest entries at the time of the network request. | Use the log and request endpoint together; the error may never appear in page HTML. |
| Critical error after an update | Fatal entry’s file, line, and first plugin/theme caller. | Use Recovery Mode or temporarily deactivate the component, then test version compatibility on staging. |
| Many warnings obscure the failure | Timestamp and earliest meaningful application error. | Group entries by request and fix the first component-specific cause before follow-on messages. |
| Developer needs the full fatal locally | Whether Recovery Mode is intercepting it. | On development only, consider WP_DISABLE_FATAL_ERROR_HANDLER true; restore the default afterward. |
A repeatable WordPress debugging checklist
- Back up the site or switch to a representative staging copy.
- Insert the four-line log-only configuration before the stop-editing comment in
wp-config.php. - Use unquoted boolean values and verify that the file remains valid PHP.
- Reproduce one known failure and note its time, URL, action, or scheduled event.
- Open the newest log entry through SSH, SFTP, or an authenticated file manager.
- Record severity, message, file, line, and the first plugin, theme, or custom function in the trace.
- Isolate one component at a time on staging and reproduce the same request.
- Use specialized tools only if ordinary log evidence cannot distinguish the cause.
- Repair and retest the confirmed cause.
- Turn
WP_DEBUGoff, remove temporary fatal-handler overrides, and delete or protect the log.
This sequence gives you the useful part of WordPress debugging—precise evidence tied to a reproducible request—without turning diagnostic output into a data leak or leaving a temporary development setting on the production site.
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.




