What causes the critical error
WordPress shows this message when PHP stops on a fatal error. Visitors see only the message. The details go to the site’s admin email and, with logging on, to a log file.
Seeing “500 Internal Server Error” instead? See how to fix the WordPress 500 error.
- A plugin or theme update with a bug, or one that conflicts with another plugin.
- Code that needs a different PHP version from the one your site runs.
- PHP running out of memory.
- A file damaged by a failed update or upload.
Use the recovery mode email
Since WordPress 5.2, WordPress emails the site’s admin address when a fatal error happens. The email names the plugin or theme at fault and links to recovery mode, where you can log in while it is paused.
- Open the inbox of your site’s admin email address.
- Find the email “Your Site is Experiencing a Technical Issue”. Check spam too.
- Click the recovery mode link and log in. The link expires after a day.
- If the email names a plugin, go to Plugins and deactivate it.
- If it names a theme, go to Appearance › Themes and activate another theme, such as Twenty Twenty-Five.
- Choose Exit Recovery Mode in the toolbar, then load the site.
- Update or replace that plugin or theme before you turn it on again.
Find the cause in debug.log
No email? Turn on WordPress debug logging. The log names the file behind the error, and WP_DEBUG_DISPLAY set to false keeps the details off the page.
- In cPanel, open File Manager and go to your WordPress folder, usually
public_html. - Edit
wp-config.phpand finddefine( 'WP_DEBUG', false );. Changefalsetotrue. If there is no such line, adddefine( 'WP_DEBUG', true );above the line that says “stop editing”. - Below it, add
define( 'WP_DEBUG_LOG', true );anddefine( 'WP_DEBUG_DISPLAY', false );, then save. - Reload the page that shows the error.
- Open
wp-content/debug.logand read the lastPHP Fatal errorline. - Note the folder after
wp-content/plugins/orwp-content/themes/. That is the plugin or theme at fault.
Disable plugins and the theme in cPanel
Can’t reach the dashboard? Turn things off by renaming folders, in cPanel File Manager or over FTP. If debug.log names one plugin, rename only that plugin’s folder.
- In
wp-content, renamepluginstoplugins-off. - Load the site. If it works, a plugin caused the error.
- Log in and open Plugins. WordPress deactivates every plugin it can no longer find.
- Rename the folder back to
plugins. - Activate plugins one at a time, loading the site after each. The one that brings the error back is the cause.
- Rename that plugin’s folder to turn it off again, then update or replace it.
- Still broken? In
wp-content/themes, rename your active theme’s folder, for examplemythemetomytheme-off. - Open Appearance › Themes. WordPress switches to a default theme such as Twenty Twenty-Five, if one is installed.
- Load the site. If it works, update the theme or ask its developer for a fix.
Check the PHP version and memory limit
Older plugins can break on a newer PHP version, and newer ones can need a newer version than your site runs. Large sites can also run out of memory.
- In cPanel, open MultiPHP Manager or Select PHP Version, and see which version your site uses.
- If the error began after a PHP change, switch back, then update the plugin or theme at fault.
- If
debug.logshowsAllowed memory size … exhausted, adddefine( 'WP_MEMORY_LIMIT', '256M' );towp-config.php, above the “stop editing” comment. - If that has no effect, raise
memory_limitin cPanel’s MultiPHP INI Editor. Full steps: how to increase the WordPress memory limit.
Restore a backup and turn debug off
If none of this finds the cause, restore the site from a backup made before the error began. Then clean up.
- Download a copy of the current files and database in cPanel › Backup, so you can undo the restore.
- Restore the files and the database from the same date. Changes made since that backup are lost.
- Once the site works, set
WP_DEBUGback tofalseinwp-config.phpand remove the two lines you added. - Delete
wp-content/debug.log. Anyone who knows its address can read it. - Rename any plugin or theme folder you turned off back to its name once it is fixed. If you no longer need it, delete it in WordPress instead.
HostUpIndia WordPress hosting
HostUpIndia WordPress plans come with WordPress pre-installed on LiteSpeed, NVMe storage and free SSL. Every plan includes cPanel for the file steps above, and daily backups kept 30 days, so there is a restore point from before an error.
- From ₹149 a month on 3-year billing. Prices exclude 18% GST. See WordPress plans.
- Support tickets and email are received 24 hours a day, 7 days a week; WhatsApp is open for questions from 10 am to 7 pm IST, Monday to Saturday.
- Free website migration by the HostUpIndia in-house team.
- Seeing “Error establishing a database connection” instead? Fix the database connection error.
- More help guides.
