If your WordPress site suddenly shows the message “There has been a critical error on this website” , do not panic. This error usually means WordPress hit a fatal PHP problem and stopped loading to protect the site. In many cases, the cause is a broken plugin update, a theme conflict, exhausted memory, or a compatibility issue with PHP or WordPress itself.
The good news is that this error is usually diagnosable if you follow the right order. The goal is not to guess. The goal is to find the exact file, plugin, theme, or server issue that triggered the crash, then reverse it safely.
If your site is down right now and you need help fast, see my WordPress Critical Error Fix Service.
Quick answer
The fastest safe way to fix a WordPress critical error is:
- Check whether WordPress sent you a Recovery Mode email.
- Enable debug logging in
wp-config.php. - Read the exact error in
wp-content/debug.log. - Disable the broken plugin or switch away from the broken theme.
- Only raise memory or update PHP if the log points to that problem.
- If the issue started after a hack or keeps returning, check for malware or database injections.
That is much safer than randomly deleting files or reinstalling things blindly.
Step 1: Check your WordPress Recovery Mode email first
Before editing files, check the site administrator email inbox. WordPress has a built-in Recovery Mode system that can send an email when a plugin or theme causes a fatal error. If you received that email, use the recovery link first. It can help you log in safely and identify the extension that caused the crash.
If you did not receive the email, or the site is still unusable, move to debug logging.
Step 2: Enable debug logging safely in wp-config.php
The most useful next step is to enable debugging, but do it in a way that logs errors instead of displaying them publicly on a live site.
Open your wp-config.php file and add this just above:
/* That's all, stop editing! Happy publishing. */
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
This tells WordPress to write errors to wp-content/debug.log without exposing sensitive details to visitors.
Step 3: Reload the site and read the real error message
Now reload the broken page, then open wp-content/debug.log. This file often gives you the exact clue you need.
Look for patterns like these:
- Plugin path in the error: usually a plugin conflict or bad update
- Theme file path: usually a broken theme function or compatibility issue
- “Allowed memory size exhausted”: memory limit problem
- Undefined function / class not found: version mismatch, missing file, or incomplete update
- Database or mysqli errors: database issue or server-side failure
This step matters because the generic critical error message itself does not tell you what failed. The log does.
Step 4: If a plugin caused the error, disable it properly
If the log points to a plugin, disable that plugin first.
If you still have dashboard access, deactivate it from Plugins → Installed Plugins.
If you are locked out of wp-admin, connect with FTP or your host’s file manager and go to wp-content/plugins/. Then:
- if you know the exact plugin causing the crash, rename only that plugin folder, or
- if you do not know which plugin is broken, temporarily rename the whole
pluginsfolder to deactivate them all.
After that, reload the site. If the site comes back, reactivate plugins one by one until the error returns. That identifies the culprit.
One important detail: this does not disable plugins inside mu-plugins, because must-use plugins load separately.
Step 5: If a theme caused the error, switch to a default theme
If the error points to your active theme, switch to a default WordPress theme such as Twenty Twenty-Four or another current default theme installed on your site.
If you cannot access the dashboard, go to wp-content/themes/ and rename your active theme folder. WordPress will usually fall back to a default theme if one is available.
This helps you confirm whether the crash is inside the theme itself or somewhere else.
Step 6: Only raise memory if the logs show a memory error
Do not increase memory just because the site is broken. Only do it if the error log shows a memory exhaustion message.
If it does, add this to wp-config.php:
define( 'WP_MEMORY_LIMIT', '256M' );
This can help in some cases, but it should not be treated as the default fix. If memory exhaustion keeps returning, there is usually a deeper cause such as a heavy plugin, bad query, runaway process, or inefficient code path.
Step 7: Check PHP compatibility and incomplete updates
Some critical errors happen because a plugin or theme expects a newer PHP feature, or because a site is running code that is no longer compatible with the current PHP version.
If the error log points to deprecated functions, syntax issues, or undefined functions after an update, check:
- your PHP version in hosting or Site Health,
- whether the plugin and theme support that PHP version,
- whether WordPress core, plugins, or themes were only partially updated.
If an update failed halfway, re-uploading the affected plugin, theme, or clean WordPress core files can solve the problem.
Step 8: Restore from backup if the site broke after an update or edit
If the critical error started immediately after a plugin update, theme change, or custom code edit, restoring the latest clean backup may be faster than manual repair.
This is especially true for ecommerce or client sites where downtime costs money. Restore first, investigate second.
What if the critical error is caused by malware?
Not every critical error is a normal plugin conflict. I have seen hacked WordPress sites show critical errors because malware modified core files, injected broken code into functions.php, or poisoned the database with malicious payloads.
If the crash started after suspicious redirects, unknown admin users, fake plugins, or repeated reinfection, the problem may be bigger than a normal update failure.
In that case, these guides may help:
- Free WordPress Malware Scan
- How to Scan and Clean Your WordPress Database for Hidden Malware
- WordPress Malware Removal Help
How to prevent this error in the future
- Always keep a working backup before updates.
- Use staging for major plugin, theme, or WooCommerce changes.
- Remove unused plugins and themes.
- Keep PHP, WordPress core, themes, and plugins compatible and updated.
- Do not edit live theme files casually.
- Monitor logs instead of waiting for the site to break publicly.
If you want a broader prevention checklist, read my WordPress security guide.
When to get expert help
You should bring in help if:
- the site is still down after disabling plugins,
- the log points to core file corruption or database problems,
- the site was hacked before the error appeared,
- you are dealing with WooCommerce, memberships, or a high-traffic business site,
- the error keeps returning after you think it is fixed.
If you want me to investigate the exact cause and repair it safely, you can hire me here.
Final thoughts
The biggest mistake people make with the WordPress critical error is treating it like a mystery. It usually is not. WordPress, PHP, and your server logs nearly always leave a trail. Once you read that trail in the right order, the fix becomes much more straightforward.
Start with Recovery Mode if available, enable logging safely, identify the exact cause, and only then apply the right fix. That is how you solve the critical error without making the situation worse.
FAQ
What causes “There has been a critical error on this website” in WordPress?
The most common causes are plugin conflicts, theme errors, PHP compatibility problems, memory exhaustion, incomplete updates, or database and server-side issues.
Can I fix a WordPress critical error without dashboard access?
Yes. You can use FTP or your host’s file manager to enable debug logging, rename plugin folders, and switch themes manually.
Should I turn on WP_DEBUG on a live site?
Yes, but preferably with WP_DEBUG_LOG enabled and WP_DEBUG_DISPLAY set to false so errors are logged instead of shown publicly.
Will increasing PHP memory fix the critical error?
Only if the actual error is memory exhaustion. If the log shows a broken plugin, theme, or PHP compatibility issue, raising memory will not solve the root cause.
What if the critical error started after a hack?
Then you should not assume it is a normal plugin conflict. Check for malware, hidden admin users, modified core files, and database injections before declaring the site clean.
Top comments (0)