21+ years in hosting · Jaipur, India · INR billing with 18% GST · 24/7 email support
Blog · WebJi® India

How to Check WordPress Error Logs

Quick answer

To check WordPress error logs, set WP_DEBUG and WP_DEBUG_LOG to true and WP_DEBUG_DISPLAY to false in wp-config.php, reproduce the fault once, then open wp-content/debug.log. The first 'PHP Fatal error' line names the plugin or theme file and line that failed. If debug.log stays empty, check the host's PHP error_log.

For WordPress site owners facing a white screen, a 500 error or a 'critical error' message who need to find the plugin or theme at fault.

✓ In business since 2005
✓ INR + GST billing
✓ 24/7 Email Support — avg reply < 60 min
GuideWebJi®
knowledge
Read time
5 min
Sections
7
Updated
14 Nov 2026
Written by
WebJi® team

Which logs record WordPress errors?

WordPress errors can appear in three logs: WordPress's own debug.log, the hosting account's PHP error_log, and the web server's error log. Only the first needs switching on; the other two run all the time.

Three places a WordPress error can be recorded
LogSwitched on byBest forHow to open it
wp-content/debug.logWP_DEBUG_LOG in wp-config.phpPlugin and theme faults, deprecated calls, noticesFile Manager, SFTP or tail over SSH
PHP error_logThe host's PHP settings (always on)Fatals on requests where WordPress never loaded fullycPanel → Metrics → Errors, or the file in the site folder
Web server error logApache, Nginx or PHP-FPM config500s with no PHP message, timeouts, permission blocksVPS: /var/log/…; shared plans: ask support

The exact folder paths on different panels are mapped in where the WordPress error log is located. This guide is about switching logging on, reading what it says and switching it off safely.

Depending on PHP configuration, an error_log may be beside the failing script, in public_html or wp-admin, or at an account-wide path. Check the PHP error_log setting in MultiPHP INI Editor or with your host; PHP file logging also depends on log_errors being enabled.

How to enable the WordPress debug log in wp-config.php

Add three constants to wp-config.php above the line /* That's all, stop editing! */: WP_DEBUG and WP_DEBUG_LOG set to true, and WP_DEBUG_DISPLAY set to false. If WP_DEBUG is already defined as false, change that line rather than adding a second one, or PHP warns about a duplicate constant.

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

Since WordPress 5.1, WP_DEBUG_LOG also accepts a file path. Writing the log outside the web root means nobody can download it, which is the safer choice on a live site:

define( 'WP_DEBUG_LOG', '/home/youruser/logs/wp-debug.log' );

With SSH and WP-CLI, the same change takes two commands and avoids hand-editing the file:

wp config set WP_DEBUG true --raw
wp config set WP_DEBUG_LOG true --raw
wp config set WP_DEBUG_DISPLAY false --raw

The log file is created only when PHP raises its first message. An absent debug.log after a test means nothing failed during that request, or the folder is not writable by PHP.

Capturing the error: a clean test in five steps

Empty the log, trigger the fault once, and read only the lines written in that minute. Old entries from past incidents are the most common reason people chase the wrong plugin.

  1. Download a copy of wp-config.php, then enable logging as above.
  2. Empty debug.log (or run : > wp-content/debug.log over SSH).
  3. Note the time, then reproduce the fault: load the broken page, save the post or run the checkout.
  4. Open the log, or run tail -n 40 wp-content/debug.log.
  5. Find the first line containing PHP Fatal error or Uncaught; that is the cause, and lines after it are side effects.

Timestamps in debug.log are in UTC because WordPress sets PHP's timezone to UTC. Add 5 hours 30 minutes to match Indian time when you compare with your notes or with the cPanel Errors screen.

How to read a WordPress debug.log entry

Every entry has four parts: the UTC time, the severity, the message and the file with its line number; the folder in that path names the culprit.

[14-Nov-2026 05:12:44 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function wc_get_order() in /home/shop/public_html/wp-content/plugins/invoice-pdf/includes/export.php:88
Stack trace:
#0 /home/shop/public_html/wp-includes/class-wp-hook.php(324): ip_export_invoice()
#1 /home/shop/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters()

Here the plugin folder invoice-pdf calls a WooCommerce function while WooCommerce is inactive or not yet loaded. The stack trace below lists the calls that led there, newest first; #0 is the nearest one.

WordPress log severities and what to do about each
SeverityEffect on the pageTypical messageAction
Fatal errorRequest stops: white screen, HTTP 500 or "critical error"Undefined function, memory exhausted, max execution timeFix now; deactivate the named plugin or theme
Parse errorWhole site downsyntax error, unexpected tokenUndo the last code edit in the named file
WarningPage loads, part may be missingCannot modify header information – headers already sentReport to the plugin author; check for stray whitespace
Notice / DeprecatedNo visible effectFunction is deprecated since version…Update the plugin before the next PHP upgrade

"Allowed memory size exhausted" has its own fix in increasing the WordPress memory limit; a blank page with no log line at all is covered in fixing the WordPress white screen.

Acting on the error when wp-admin will not open

Disable the plugin or theme named in the fatal line from outside WordPress, then reload the site. Since WordPress 5.2, a fatal also triggers recovery mode: the admin email receives a link that opens wp-admin with the faulty extension paused.

  • File Manager or SFTP: rename wp-content/plugins/invoice-pdf to invoice-pdf.off; WordPress deactivates it on the next load. Steps are in managing plugins from cPanel.
  • WP-CLI: wp plugin deactivate invoice-pdf, or wp theme activate twentytwentyfive for a theme fault.
  • After a PHP upgrade: if many plugins throw fatals at once, switch the PHP version back first, as shown in changing the PHP version in cPanel, then update plugins one by one.

If debug.log stays empty but the site still returns 500, the request failed before WordPress loaded. Check the account error_log and the server log described in Apache log files explained.

If the site loads but a particular admin screen is slow or shows notices, Query Monitor can show errors, database queries, hooks and memory for a request. It does not create debug.log and cannot help when the admin screen itself cannot load; remove it after troubleshooting.

Turning WordPress debug logging off and protecting the file

Set WP_DEBUG back to false once you have copied the lines you need, then delete or block debug.log, because the default location is publicly downloadable. The file exposes server paths and plugin names that help an attacker.

On Apache or LiteSpeed, block it in the root .htaccess (finding that file is covered in how to find .htaccess in cPanel):

<Files "debug.log">
  Require all denied
</Files>

On Nginx, add location = /wp-content/debug.log { deny all; } to the server block and reload. A plugin that writes a warning on every page view can grow the file by hundreds of megabytes and fill a shared plan's quota, so never leave logging on unattended.

What to send support from a WordPress error log

Send the time of your test, the first fatal line with its path, the PHP version and whether the fault hits the public site, wp-admin or both. Remove any line that prints a password or API key before you paste it.

Share only the relevant lines and redact personal data such as email addresses or order details; logs may contain form data and database or server paths.

On WebJi® WordPress hosting, email support@webji.services at any hour in Hindi or English; the average first reply is under 60 minutes. Phone support on +91 141 4941811 runs during business hours.

FAQ

Frequently asked questions

Why is there no debug.log file after I enabled WP_DEBUG_LOG?

Either no PHP message was raised during your test, or PHP cannot write to wp-content. Check that the constants sit above the stop-editing line, that WP_DEBUG is true, and that the folder permission is 755. A custom path must point to a folder that already exists.

Does enabling WP_DEBUG slow down my site?

Slightly, because every notice is written to disk, and noisy plugins can generate thousands of lines an hour. For a short test the effect is negligible. Turn it off once you have captured the fault.

What does "There has been a critical error on this website" mean?

It is WordPress's fatal-error handler hiding a PHP fatal from visitors. The actual message is in debug.log or the PHP error log, and the site admin usually receives a recovery-mode email with a link to sign in and pause the faulty plugin or theme.

What is SCRIPT_DEBUG and do I need it?

SCRIPT_DEBUG makes WordPress load the unminified core CSS and JavaScript files. It helps when debugging editor or admin scripts in the browser console, but it does not add anything to debug.log. Leave it off for PHP errors.

Checked 14 November 2026 against the WordPress developer documentation on debugging · Reviewed by the WebJi® team, Jaipur.

WebJi® since 2005

Ready to get started with WebJi®?

Join 12,000+ businesses across India and overseas. INR pricing, 18% GST shown before payment and 24/7 email support in Hindi and English — average first reply under 60 minutes.