How to Fix WordPress Error Logging Not Working wp_debug True?
If you have set `WP_DEBUG` to `true` but WordPress is still not writing errors to a log file, you are not alone. This is one of those WordPress problems that can leave beginners wondering whether they changed the wrong setting, edited the wrong file, or simply misunderstood how debugging works.
The good news is that the problem is usually fixable.
WordPress has several debugging constants that control how PHP errors and warnings are displayed and recorded. Simply adding `WP_DEBUG` to `wp-config.php` does not always mean errors will automatically appear in `debug.log`.
In this guide, we will explain why wordpress error logging not working wp_debug true happens and show you exactly what to check. You will also learn how to enable proper logging, find the log file, test whether logging works, and disable debugging safely when you finish troubleshooting.

The Core Basics
Before fixing WordPress error logging, it helps to understand the three main debugging settings.
`WP_DEBUG` is the master WordPress debugging switch. When it is set to `true`, WordPress enables its built-in debugging features.
For example:
“`php
define( ‘WP_DEBUG’, true );
“`
However, `WP_DEBUG` alone does not necessarily tell WordPress to save errors into a file.
That is where `WP_DEBUG_LOG` comes in:
“`php
define( ‘WP_DEBUG_LOG’, true );
“`
This tells WordPress to write debugging information to a log file. In a standard setup, that file is usually:
“`text
/wp-content/debug.log
“`
There is also `WP_DEBUG_DISPLAY`, which controls whether errors are displayed on the website:
“`php
define( ‘WP_DEBUG_DISPLAY’, false );
“`
For a live website, hiding errors from visitors is normally preferable. You can still record the errors while keeping technical information away from the public.
A typical troubleshooting configuration therefore looks like this:
“`php
define( ‘WP_DEBUG’, true );
define( ‘WP_DEBUG_LOG’, true );
define( ‘WP_DEBUG_DISPLAY’, false );
“`
These settings work together. If your wordpress error logging not working wp_debug true, checking all three settings is a sensible starting point.
💡 WP Fix It Co Recommendation: If you are dealing with wordpress error logging not working wp_debug true, a fast, secure WordPress host can make troubleshooting much easier and help you implement the solution smoothly. Reliable server performance, current PHP versions, and straightforward hosting controls can remove many common hosting-related problems. Get Hostinger WordPress Hosting here.
Step-by-Step Guide to Fix WordPress Error Logging
1. Check Your wp-config.php File
The first place to look is your `wp-config.php` file.
This file is located in the main directory of your WordPress installation. Depending on your hosting provider, you may access it through a hosting file manager, FTP, or another file management tool.
Look for:
“`php
define( ‘WP_DEBUG’, true );
“`
If it says `false`, debugging is disabled.
You also need to check whether logging has been enabled:
“`php
define( ‘WP_DEBUG_LOG’, true );
“`
If the second line is missing, add it.
For a live website, add:
“`php
define( ‘WP_DEBUG_DISPLAY’, false );
“`
Your configuration should look similar to:
“`php
define( ‘WP_DEBUG’, true );
define( ‘WP_DEBUG_LOG’, true );
define( ‘WP_DEBUG_DISPLAY’, false );
“`
2. Check Where the Debug Log Is Being Created
After enabling logging, look inside your WordPress `wp-content` folder.
You may find:
“`text
debug.log
“`
The full path is normally:
“`text
/wp-content/debug.log
“`
If the file does not exist, do not immediately assume that logging is broken.
WordPress generally creates the file when an error or debugging message is generated. If nothing has been logged, there may simply be no entry yet.

3. Check for Duplicate Debugging Definitions
This is a common beginner mistake.
You might find something like:
“`php
define( ‘WP_DEBUG’, false );
“`
near the top of the file and then later add:
“`php
define( ‘WP_DEBUG’, true );
“`
Do not assume the second line will solve the problem.
You should have one clear definition for each debugging constant. Remove conflicting definitions and keep the configuration tidy.
Also avoid accidentally creating:
“`php
define( ‘WP_DEBUG_LOG’, ‘true’ );
“`
Although PHP may interpret values in unexpected ways depending on the context, using the proper Boolean value is clearer:
“`php
define( ‘WP_DEBUG_LOG’, true );
“`
4. Make Sure You Edited the Correct WordPress Installation
This sounds obvious, but it happens frequently.
If your hosting account contains multiple websites, staging installations, subdomains, or development copies, you might edit the wrong `wp-config.php`.
Confirm that the file belongs to the website you are troubleshooting.
A quick way to check is to look at the surrounding WordPress files. The correct installation should contain familiar directories such as:
* `wp-admin`
* `wp-content`
* `wp-includes`
5. Check File Permissions
WordPress needs permission to write the log file.
If the server cannot write to `wp-content`, logging may fail even though `WP_DEBUG` and `WP_DEBUG_LOG` are configured correctly.
Check the permissions for the `wp-content` directory and any existing `debug.log` file.
Do not blindly make files writable by everyone. Excessive permissions can create security problems.
If you are unsure about permissions, ask your hosting provider to verify that the WordPress installation can write to its `wp-content` directory.
6. Check Your PHP Error Configuration
WordPress debugging does not operate completely independently of PHP.
Your hosting environment controls PHP configuration, and certain server-level settings can affect how errors are handled.
If WordPress logging appears correctly configured but nothing is being recorded, contact your host and ask them to check the PHP error logs and server configuration.
This is particularly useful when the problem involves:
* PHP fatal errors
* PHP version incompatibilities
* Server configuration problems
* Memory limits
* Plugin conflicts
* Theme-related PHP errors
7. Look for Plugin or Theme Conflicts
Sometimes the logging configuration is correct, but the problem originates from a plugin or theme.
If you recently installed or updated something and WordPress started behaving strangely, that plugin or theme should be investigated.
Typical symptoms include:
* White screens
* Broken layouts
* Admin pages failing
* PHP warnings
* Unexpected redirects
* Features suddenly disappearing
If you can safely reproduce the problem, check the log immediately afterward.
The error may identify the plugin, theme, PHP file, or function causing the issue.
8. Test Logging Properly
Once the configuration is in place, you need to determine whether WordPress can actually write to the log.
Do not rely on waiting for a random error.
A controlled test can be performed by generating a harmless PHP notice or using an appropriate temporary debugging method. However, avoid deliberately introducing fatal errors into a live production website.
After reproducing the problem, check:
“`text
/wp-content/debug.log
“`
If new entries appear, your logging system is working.
At that point, you can concentrate on the actual error rather than the logging configuration.
## Best Practices and Pro Tips
Debugging is extremely useful, but it should be treated as a troubleshooting tool rather than a permanent production setting.
When investigating a live website, consider using:
“`php
define( ‘WP_DEBUG’, true );
define( ‘WP_DEBUG_LOG’, true );
define( ‘WP_DEBUG_DISPLAY’, false );
“`
This allows you to record useful information without displaying potentially sensitive technical details to visitors.
Keep your WordPress core, themes, and plugins updated. Many PHP errors are caused by outdated code interacting with newer PHP versions.
Make backups before editing `wp-config.php`. A small syntax mistake in this file can prevent WordPress from loading correctly.
Also, remember to remove or disable debugging when your investigation is finished. Leaving debugging enabled indefinitely can generate unnecessary log files and potentially expose information that should remain private.
If your `debug.log` becomes very large, remove or archive it after resolving the underlying problem.
Common Mistakes to Avoid
1. Only enabling WP_DEBUG
Setting:
“`php
define( ‘WP_DEBUG’, true );
“`
does not necessarily give you the file logging you expect. Add `WP_DEBUG_LOG` as well.
2. Displaying errors publicly
Avoid leaving:
“`php
define( ‘WP_DEBUG_DISPLAY’, true );
“`
on a production website unless you have a specific reason.
3. Editing the wrong wp-config.php
Multiple WordPress installations can make this surprisingly easy. Confirm the file belongs to the affected site.
4. Ignoring permissions
If WordPress cannot write to `wp-content`, the log may never be created or updated.
Conclusion: Get WordPress Logging Working Again
When **wordpress error logging not working wp_debug true** appears to be the problem, start with the basics. Check `wp-config.php`, enable both `WP_DEBUG` and `WP_DEBUG_LOG`, make sure errors are not being displayed publicly, and then look inside `wp-content` for `debug.log`.
If the file still does not appear, investigate permissions, the correct WordPress installation, PHP configuration, and possible plugin or theme conflicts.
Most importantly, do not treat debugging as a permanent setting. Use it to identify the problem, fix the underlying cause, and then switch debugging off when you are finished.
At WP Fix It Co, our goal is to make WordPress troubleshooting easier to understand and less intimidating. If your website is giving you an error you cannot explain, work through the checks above one at a time. A systematic approach is often all it takes to find the culprit.