How to Fix the WordPress Critical Error: Step-by-Step Troubleshooting Guide
Seeing “There has been a critical error on this website”? Start by checking the WordPress administrator email for a recovery link. If you cannot log in, inspect the PHP error log, temporarily disable the plugin that caused the failure, and check your PHP version and memory limits. Back up your files and database before making changes.
What does the WordPress critical error mean?
This message usually means a PHP fatal error has stopped WordPress from completing a request. A recently updated plugin, incompatible theme, PHP version mismatch, exhausted memory, or damaged core files may be responsible. The message itself does not identify the culprit: the error log does.
Before you troubleshoot: protect the site
- Record when the error started and which plugins, themes or PHP settings changed immediately beforehand.
- Create a recoverable backup of both the database and WordPress files. If your host provides a snapshot, remember that a snapshot is not a substitute for a verified independent backup.
- Use SFTP or the hosting file manager, rather than editing live files blindly. Keep a copy of each file before changing it.
- For a busy store or membership website, arrange a maintenance window if a fix might interrupt transactions.
For a broader backup comparison, see DigitalBerg’s guide to backups versus server snapshots.
1. Check your WordPress administrator email and Recovery Mode
WordPress may email the site administrator a notice describing the error and providing a time-limited Recovery Mode login link. Check the inbox and spam folder for the address configured in WordPress. If the link works, log in, review the affected plugin or theme, and deactivate it temporarily. Do not forward the recovery link publicly.
If no email arrived, continue with the log-based steps below. Email delivery can fail, and an absent message does not prove the site is safe.
2. Enable a private WordPress debug log
Open wp-config.php in the WordPress installation directory. Before the line that says to stop editing, add or adjust these constants, ensuring each is defined only once:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
Reload the failing page once, then check wp-content/debug.log. Also check the web server or PHP-FPM error log, because not every failure appears in the WordPress log. Look for PHP Fatal error, the file path, and the timestamp. A path containing /wp-content/plugins/plugin-name/ points toward a plugin; /wp-content/themes/theme-name/ suggests a theme. A path is a clue, not proof of root cause.
Security: debug logs can contain sensitive paths or data. Restrict access to the log, never enable WP_DEBUG_DISPLAY on a public production site, and switch debugging off after the investigation. Remove or securely retain logs according to your security policy.
3. Disable a faulty plugin without wp-admin
In cPanel File Manager, Virtualmin File Manager, or SFTP, navigate to wp-content/plugins/. If the log names a specific plugin, rename only that plugin directory, for example example-plugin to example-plugin.disabled. Reload the website. If it works, you have isolated a likely conflict. Keep the plugin disabled until you confirm a compatible release or obtain a fix.
If the log gives no clue, you can temporarily rename the entire plugins directory to plugins.disabled to isolate regular plugins. Restore the original directory name and reactivate plugins one at a time after you regain access. Be aware that disabling plugins may interrupt payment, security, caching or other essential functions. Must-use plugins in wp-content/mu-plugins are not disabled by renaming the normal plugins directory.
With WP-CLI, and only after verifying the WordPress path and current user, you can list plugins:
wp plugin list --path=/path/to/wordpress
For a known failing plugin:
wp plugin deactivate example-plugin --path=/path/to/wordpress
WP-CLI may itself fail to bootstrap when the fatal error occurs early; in that case, use the file manager method.
4. Rule out a theme problem
If the error began after a theme update or customization, examine the log for a theme file path, especially functions.php. If wp-admin works, activate an installed compatible default WordPress theme to test. If it does not, first ensure a working fallback theme is installed, then use a backup and an experienced administrator to isolate the active theme through the file system. Do not delete a custom theme or overwrite its changes without a backup.
5. Verify the PHP version and extensions
A plugin or theme can call functions unavailable in the server’s PHP version or require an extension that is missing. Compare the actual PHP version against the requirements for your WordPress version and each affected plugin/theme. In cPanel, use the available PHP selector or MultiPHP Manager; in Virtualmin, inspect the domain’s PHP execution settings; on a self-managed VPS, inspect the PHP-FPM pool and installed extensions. Test changes in staging where possible, and avoid switching PHP versions without checking compatibility across the whole site.
6. Investigate memory exhaustion
If the log includes Allowed memory size exhausted, check the PHP memory limit and the workload that triggered it. A WordPress configuration setting cannot exceed the PHP/server limits imposed by the hosting environment. On suitable hosting, the following can request a larger WordPress memory allocation:
define( 'WP_MEMORY_LIMIT', '256M' );
Do not add a duplicate constant. The value is an example, not a universal recommendation. Confirm available RAM and PHP configuration before increasing limits, especially on a small VPS. Repeated exhaustion may signal a plugin loop, oversized imports or insufficient resources rather than a simple configuration issue.
7. Check failed updates and damaged core files
If the error appeared during a WordPress update, review disk space, file ownership, and update logs. Do not replace wp-content or wp-config.php with fresh-install copies. Experienced administrators can use WP-CLI to verify WordPress core checksums:
wp core verify-checksums --path=/path/to/wordpress
Checksum mismatches need investigation; customized or localized files can affect interpretation. If core repair is necessary, use official WordPress packages and a tested backup, or ask your hosting administrator to perform the repair.
8. Hosting-specific troubleshooting
cPanel hosting
Open File Manager to inspect public_html or the relevant domain document root, and use the hosting account’s Errors feature or PHP error logs if available. Check PHP settings using the tools your provider enables. On shared hosting, contact support before modifying server-wide settings.
Virtualmin hosting
Select the correct virtual server, locate its website document root, inspect the domain’s error logs and PHP execution mode, and verify file ownership. Virtualmin layouts vary by installation, so confirm paths instead of assuming public_html is universal.
Self-managed Linux VPS
Check the active web server, PHP-FPM service and application logs. Depending on your distribution and service names, useful read-only diagnostics include:
df -h
free -h
systemctl --failed
journalctl -u php8.3-fpm --since "30 minutes ago" --no-pager
Replace php8.3-fpm with your installed service name. Avoid blindly restarting services or changing permissions. For remote access basics, see how to connect to a VPS using SSH.
9. Verify the fix and prevent a repeat
- Test the homepage, wp-admin, checkout/forms, login, scheduled tasks and any affected page.
- Confirm the PHP fatal error no longer appears in new log entries.
- Restore temporary directory names and keep only the identified problematic component disabled.
- Turn off production debugging and protect or remove diagnostic logs.
- Update WordPress, themes and plugins using a staging-first workflow and keep tested backups.
When should you contact hosting support?
Contact support when you cannot access the file system, logs show PHP-FPM or server failures, the database or disk is unavailable, or a business-critical site remains offline after isolating plugins and themes. Share the timestamp, relevant redacted log lines, PHP version and recent changes. Never send passwords or recovery links in an ordinary support message.
DigitalBerg offers hosting and infrastructure services for websites and applications. If you manage your own VPS, review server capacity and backup coverage before increasing resource limits.
Frequently asked questions
Can I fix a WordPress critical error without logging in?
Often, yes. Use the administrator recovery email, SFTP or a hosting file manager to inspect logs and isolate the failing plugin. Back up the site first.
Will deactivating plugins delete my content?
Ordinary plugin deactivation usually preserves stored content, but some functionality can disappear and plugin-specific behavior varies. Avoid uninstalling or deleting plugin data during initial diagnosis.
Does increasing the PHP memory limit always fix the error?
No. It helps only when memory exhaustion is the cause and the server permits the change. A PHP syntax error or incompatible plugin needs a different fix.
Should I leave WP_DEBUG enabled?
Disable it after diagnosis on a production website. Keep errors hidden from visitors and control access to any retained log files.
Official references
- WordPress Developer Handbook: Common WordPress Errors
- WordPress Developer Handbook: Debugging in WordPress
- WordPress Troubleshooting FAQ
Editorial note: commands and menu locations are illustrative and must be adapted to your hosting configuration. No production benchmark or live server test is claimed in this guide.






Leave a Reply
Want to join the discussion?Feel free to contribute!