
"There has been a critical error on this website" means PHP hit a fatal error and WordPress stopped loading the page. It is almost always caused by a plugin or theme (often right after an update), a PHP version mismatch, running out of memory, or corrupted core files. WordPress usually emails the admin a recovery mode link that names the faulty plugin. If you do not get the email, you can find the cause in the debug log and disable the culprit through File Manager. This guide shows the exact steps.
- Check the admin email inbox (and spam) for "Your Site is Experiencing a Technical Issue". It contains a recovery link.
- Turn on
WP_DEBUG_LOGto see the exact file and line causing the error. - Disable a plugin by renaming its folder in
wp-content/plugins. - Restore a backup if you cannot find the cause quickly, then fix on staging.
Step 1: Use recovery mode
Since WordPress 5.2, the site sends an email to the admin address with the subject "Your Site is Experiencing a Technical Issue". It names the plugin or theme and contains a special login link. Click it, log in, and WordPress lets you into the dashboard with the faulty extension paused, so you can deactivate, update or replace it. Also, this matters for WordPress critical error on every kind of site.
Step 2: Turn on the debug log
Edit wp-config.php in File Manager or via SFTP and add, above /* That's all, stop editing! */: So keep this in mind whenever you work on WordPress critical error.
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
Reload the broken page, then open wp-content/debug.log. Look for a line starting with PHP Fatal error:
PHP Fatal error: Uncaught Error: Call to undefined function create_function()
in /home/user/public_html/wp-content/plugins/old-slider/slider.php:42
The path tells you the culprit: here, the old-slider plugin. When you finish, set WP_DEBUG back to false and delete debug.log, because it can expose server paths.
Step 3: Disable the faulty plugin
Without dashboard access:
- Open
wp-content/pluginsin File Manager. - Rename the plugin's folder, for example
old-slidertoold-slider-off. WordPress deactivates it automatically. - If you do not know which plugin, rename the whole
pluginsfolder toplugins-off, check the site loads, rename it back, then disable plugins one by one.
With WP-CLI over SSH:
wp plugin list --status=active
wp plugin deactivate old-slider
wp plugin deactivate --all # last resort
Step 4: Check the theme
If the log points to wp-content/themes/your-theme/, switch to a default theme. Rename the active theme's folder; WordPress falls back to an installed default theme such as Twenty Twenty-Five (make sure one is installed). Or run wp theme activate twentytwentyfive. Errors in functions.php after a code snippet was added are a very common cause; undo the last edit.
Step 5: Memory limit errors
If the log says Allowed memory size of 134217728 bytes exhausted, PHP ran out of memory. Increase the limit in wp-config.php:
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' ); // admin tasks
The server's own memory_limit in the PHP settings must be at least this high. If memory keeps running out, a plugin may be leaking memory, or the site needs better hosting; see our hosting comparison.
Step 6: PHP version problems
If the error started after your host changed the PHP version, errors such as Call to undefined function or TypeError usually mean old code. Temporarily switch back to the previous PHP version in your hosting panel, then update or replace the plugin. Our PHP update guide explains the safe process.
Step 7: Reinstall core files
If the error points to wp-includes or wp-admin, core files may be corrupted or modified (sometimes by malware). Reinstall core without touching content:
wp core verify-checksums
wp core download --force --skip-content
Or in the dashboard: Dashboard → Updates → Re-install. If files were modified unexpectedly, scan for malware; see our security hardening guide.
Step 8: Restore a backup
If the site is a business-critical store and the fix is not obvious, restore the most recent backup to get it online, then reproduce and fix the problem on a staging copy. Note any orders or form entries received since the backup.
WordPress critical error: how to prevent it
- Update plugins in small batches, and test major updates on staging.
- Keep daily backups with one-click restore.
- Avoid editing
functions.phpdirectly on the live site; use a code snippets plugin with error protection or a child theme on staging. - Use maintained plugins and a supported PHP version.
- Set up uptime monitoring so you know within minutes.
WordPress critical error: frequently asked questions
WordPress critical error: is the critical error a hack?
Usually not; it is mostly a plugin or theme conflict. But if core files show unexpected changes, scan for malware.
WordPress critical error: I did not receive the recovery email. Why?
The admin email may be out of date, or your server cannot send mail reliably. Use the debug log method instead, and set up SMTP for reliable email.
Related guides: 404 Error, 403 Forbidden Error and ERR_TOO_MANY_REDIRECTS.
For official guidance, see the official WordPress documentation.
Site down right now?
Our support team fixes critical errors and white screens quickly. Contact us.
Written by the ItsWebExpert team, a web design and development company in Karachi building websites, online stores and apps for businesses across Pakistan.
Ask a Question on WhatsApp