If you are troubleshooting a WordPress website, the error log can show what is going wrong behind the scenes. It may reveal PHP errors, plugin conflicts, theme problems, or other issues that are not obvious on the page. But where is the WordPress error log, and what should you do if it is missing?
In a standard WordPress installation, the debug log is usually located at wp-content/debug.log. It may not exist until logging is enabled and WordPress records an error. Your hosting provider may also keep separate PHP or server error logs in your hosting dashboard. This guide explains where to find each log, how to turn on WordPress logging, and how to use the information safely.
Where Is the WordPress Error Log Located?
When WordPress debugging is enabled, the default WordPress debug log is usually found here:
your-site-root/wp-content/debug.log
The site root is the main folder containing WordPress files such as wp-config.php, wp-admin, and wp-content. For example, if your WordPress files are installed in a folder named public_html, the default log path is typically public_html/wp-content/debug.log.
The file might not be there yet. WordPress generally creates it when debugging is enabled and an error is written. If you do not see it, check that logging is configured, that the server can write to the file or folder, and that an error has occurred since you enabled logging.
How to Find the Log in Your Hosting Account
You can look for debug.log using your hosting provider’s file tools. The exact steps depend on your host, but these are common methods:
-
Hosting control panel: Open a tool such as cPanel File Manager and navigate to your WordPress installation’s
wp-contentfolder. Turn on the option to show hidden files if needed. -
FTP or SFTP: Connect with an FTP client, open the site’s document root, and browse to
wp-content. SFTP is preferable when your host provides it because it encrypts the connection. -
SSH: If you have command-line access, navigate to the WordPress directory and inspect the file. For example,
tail -n 50 wp-content/debug.logdisplays the most recent lines. - Managed WordPress dashboard: Some hosts provide a dedicated error-log viewer or a support panel that displays PHP errors without requiring you to browse files.
If WordPress is installed in a subdirectory, the log will usually be inside that installation’s wp-content folder, not necessarily the website’s top-level directory. If you are unsure where the installation lives, look for wp-config.php or ask your hosting provider.
How to Enable the WordPress Debug Log
WordPress does not always write a debug log by default. To enable it, edit the wp-config.php file in your WordPress root directory. Make a backup before changing the file, and use your host’s file manager or SFTP rather than editing it through an unfamiliar online tool.
Find the comment that says That's all, stop editing! Happy publishing. Add the following settings above that line:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
WP_DEBUG enables WordPress debugging. WP_DEBUG_LOG tells WordPress to write debug messages to a log file, normally wp-content/debug.log. WP_DEBUG_DISPLAY prevents errors from being printed directly on pages visitors can see. Keep it set to false on a live site to avoid exposing technical details to the public.
Check wp-config.php before adding these lines. If the constants are already defined, edit the existing settings instead of defining them again. Duplicate definitions can cause confusion and may mean the setting you intended to change is not the one being used.
On supported WordPress versions, you can also provide a specific log-file path instead of using the default. For example, WP_DEBUG_LOG can be set to a file path. Use a path that is valid for your server, and ask your host for help if you are not sure how to specify it.
What If There Is No debug.log File?
A missing debug.log does not necessarily mean anything is broken. The file may only be created after WordPress has something to record. If you have enabled debugging but the log is still missing, check the following:
-
Confirm the settings: Make sure the debug constants are in
wp-config.php, are spelled correctly, and appear before the “stop editing” comment. -
Check for existing definitions: Search the file for
WP_DEBUG,WP_DEBUG_LOG, andWP_DEBUG_DISPLAY. Avoid adding a second set of constants. - Reproduce the issue: Visit the page or perform the action that triggers the problem, then check the log again.
- Check file permissions: WordPress needs permission to create or write to the log. Do not make files or folders broadly writable as a quick fix; ask your host to confirm the appropriate permissions.
- Look for a host-level log: Your provider may record PHP errors in a separate error log even when the WordPress debug log is unavailable.
-
Check the installation path: If WordPress is installed in a subdirectory, inspect that installation’s
wp-contentfolder.
Some hosts restrict file writing or route errors to their own logging system. In that case, contact support and ask where your account’s PHP error log is located and whether WordPress can write to wp-content/debug.log.
WordPress Debug Log vs. PHP and Server Error Logs
The WordPress debug log is not the only place errors may appear. A hosting account can have several kinds of logs, and the right one depends on the problem.
-
WordPress debug log: Commonly
wp-content/debug.log. It records WordPress debugging messages when the relevant settings are enabled. - PHP error log: Records errors generated by PHP. The location is determined by the server and hosting configuration, so it varies between providers.
- Web server error log: Records issues from the web server, such as Apache or Nginx. This can help diagnose server-level failures and access problems.
- Hosting activity or security logs: Some providers offer separate tools for events such as blocked requests, resource limits, or security rules.
If the whole website is unavailable, a server or PHP log may contain information that the WordPress debug log does not. If the site loads but a particular plugin or theme feature fails, the WordPress log is a useful place to start. Your host can tell you which logs are available for your account.
How to Read the WordPress Error Log
Open the log with a plain-text editor or your hosting file manager’s viewer. Newer entries are usually added near the end of the file, so start there when investigating a recent issue. A typical PHP error line includes a date or time, an error type, a message, and a file path with a line number.
Look for a filename or folder associated with the part of the site that is failing. A path containing wp-content/plugins/ may point to a plugin, while a path containing wp-content/themes/ may involve the active theme. The file mentioned in an error is a clue, not always proof of the root cause: one component can trigger an error in another.
When searching for help, note the exact error message, the affected file, and the approximate time it occurred. Remove private information before sharing log excerpts publicly. Logs can include server paths, usernames, request details, or other information you should not publish.
How to Use the Log to Troubleshoot a Problem
Use the log alongside a specific action that reproduces the problem. This makes it easier to connect a new entry with the issue you are investigating.
- Write down what you were doing and the time the problem occurred.
- Reproduce the issue once, then inspect the newest log entries.
- Look for a repeated error and note the file path and line number.
- If a plugin appears to be involved, test it carefully on a staging site or after making a backup. Deactivating plugins on a live site can affect visitors and business functions.
- After identifying the likely cause, update or configure the responsible component, or ask its developer or your host for assistance.
A log entry can be caused by outdated software, an incompatible plugin, a theme issue, a PHP version mismatch, or a server limitation. Avoid changing code based on a single line unless you understand its effect. For complex errors, send the relevant, redacted excerpt to a qualified developer or hosting support team.
Is It Safe to Leave WordPress Debugging On?
Debugging can be useful during investigation, but it is not generally a setting to leave enabled indefinitely on a production website. Debugging may generate large files, use extra disk space, or record details that should not be publicly accessible. Displaying errors on the site can also expose technical information to visitors.
When you finish troubleshooting, turn off debugging by setting WP_DEBUG to false or removing the temporary settings you added, while preserving any configuration your developer or host specifically requires. Delete or securely archive the log according to your site’s retention needs. If you keep it, make sure it is not publicly accessible and is protected under your host’s security controls.
Frequently Asked Questions
Does WordPress have an error log in the admin dashboard? WordPress does not normally provide a built-in dashboard screen for the debug log. You can access it through your host’s file manager, SFTP, SSH, or a hosting-provided log viewer.
Where is debug.log on a standard WordPress site? The usual location is wp-content/debug.log inside the WordPress installation. A custom configuration or hosting setup may use a different path.
Why is the log empty? Debug logging may not be enabled, the problem may not generate a WordPress debug message, or the server may not be able to write to the file. Check your settings and ask your host about PHP logs if needed.
Can I delete debug.log? You can generally remove an old log after saving any information you still need. If debugging remains enabled, WordPress may create the file again when another message is recorded.
Conclusion
The WordPress error log is usually located at wp-content/debug.log, but it may not appear until debugging is enabled and an error is recorded. To find it, use your hosting file manager, SFTP, SSH, or your provider’s log viewer. If it is missing, verify the wp-config.php settings, check the installation path and write permissions, and look for a separate PHP error log.
Use the log to identify useful clues, protect its contents, and turn off temporary debugging when troubleshooting is complete. If the message is unclear or the issue affects your live site, your hosting provider or a WordPress developer can help interpret it safely.