Skip to content
    Tech support guide

    How to Fix "There Has Been a Critical Error on This Website" in WordPress

    The WordPress critical error means PHP hit a fatal error, usually from a plugin, a theme or a PHP version mismatch. Back up first, use recovery mode or the debug log to find the cause, then disable or roll back the culprit.

    Updated 6 min readGus, MaintainHQ

    Laptop showing a WordPress critical error message beside a code editor with a debug log open

    "There has been a critical error on this website" means PHP hit a fatal error and WordPress could not finish loading the page. It is almost always caused by one plugin, one theme or a PHP version mismatch. To fix it, back up the site, find the culprit through recovery mode or the debug log, then deactivate or roll it back.

    What does the critical error mean?

    WordPress shows this message when PHP stops with a fatal error. Instead of a blank white screen, WordPress catches the failure and shows a polite notice to visitors, and often to you in the admin area too.

    The message itself is generic. The real cause is written to a log, and in most cases WordPress also emails the site administrator with the name of the plugin or theme that failed.

    What causes the WordPress critical error?

    The usual causes are:

    • A plugin or theme update that contains a bug or conflicts with another plugin
    • Code that needs a newer, or older, PHP version than the server runs
    • A custom snippet added to functions.php with a typo
    • PHP running out of memory on a heavy page
    • Corrupted or incomplete files after a failed update

    If the error appeared straight after an update, a new plugin or a code change, start with that change.

    How do you recognise it?

    You will usually see one or more of these signs:

    • The front end, the admin area or both show the critical error message
    • The problem started right after an update, an install or a code edit
    • The site administrator receives an email from WordPress saying the site is experiencing a technical issue

    That email is worth finding. It often names the plugin or theme that caused the error and includes a recovery mode link. Check the inbox for the site's admin email address, including the spam folder.

    How do you fix it safely, step by step?

    Work through these steps in order. Each one either fixes the site or narrows down the cause.

    Step 1: Take a backup first

    Before changing anything, copy the site as it is now. Even a broken site holds content, orders and settings you do not want to lose.

    • If you can reach the dashboard (for example through recovery mode), run your usual backup tool.
    • If you cannot, use your host's backup or snapshot feature, if it has one.
    • Manually, download wp-content and wp-config.php over SFTP, and export the database with phpMyAdmin or with WP-CLI using wp db export.

    Store the backup somewhere other than the server itself.

    Step 2: Try recovery mode

    Click the recovery mode link in the admin email. It logs you in with the faulty plugin or theme paused for your session only, so visitors still see the error.

    1. Look for the notice at the top of the dashboard naming the problem plugin or theme.
    2. Deactivate it, or roll it back to the previous version.
    3. Exit recovery mode and check the site in a private browser window.

    Step 3: Turn on debugging to find the cause

    If there was no email, or it did not name a cause, write errors to a log file. Add these lines to wp-config.php, above the line that says to stop editing:

    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );
    

    Reload the broken page, then open wp-content/debug.log and look for a line beginning "PHP Fatal error". The file path in that line, such as wp-content/plugins/plugin-name/, usually names the culprit. Set WP_DEBUG back to false afterwards and delete the log, as it can contain information you would not want public.

    Step 4: Deactivate plugins without the dashboard

    1. Connect over SFTP or your host's file manager.
    2. In wp-content, rename the plugins folder to plugins-off.
    3. Reload the site. If it works, a plugin is to blame.
    4. Rename the folder back to plugins. WordPress will show every plugin as deactivated.
    5. Reactivate them one at a time, checking the site after each, until the error returns.

    With WP-CLI, wp plugin deactivate --all does the same job, and wp plugin deactivate plugin-name disables a single plugin.

    Step 5: Rule out the theme

    Rename the active theme's folder in wp-content/themes. WordPress falls back to a default theme if one is installed. If the site loads, the theme, or a recent edit to its functions.php, is the problem.

    Step 6: Check PHP version and memory

    If the log mentions functions that do not exist or syntax errors in code that looks fine, compare the server's PHP version with the plugin's stated requirements. Change it on staging first if you can. If the log says "Allowed memory size exhausted", raise the limit in wp-config.php with define( 'WP_MEMORY_LIMIT', '256M' );. Your host's own limit still applies.

    Step 7: Restore if all else fails

    If the site must be back online quickly, restore the most recent working backup. Then reproduce the problem on a staging copy, where you can take your time.

    How do you stop it happening again?

    • Test updates on staging before applying them to live sites
    • Update plugins in small batches so you know what changed
    • Keep regular off-site backups, and test that they restore
    • Keep the admin email address current, so recovery mode emails reach someone
    • Avoid editing theme files directly on a live site

    If you look after several client sites, safe updates and tested backups take most of this off your plate. See fixing a broken site for how MaintainHQ handles it.

    The critical error looks alarming, but it is usually one faulty plugin, theme or snippet away from being fixed. Back up first, find the cause, and change one thing at a time.

    Frequently asked questions

    Will I lose my content because of the critical error?

    No. The critical error stops PHP from finishing the page, but your posts, pages, orders and settings stay in the database and your uploads stay in wp-content/uploads. Take a backup before you start fixing anything, so a wrong step during the repair cannot cost you data either.

    Why did I not get the recovery mode email?

    WordPress sends it to the site's admin email address, so it fails if that address is out of date, if the server cannot send email or if the message went to spam. Check the address under Settings, General once you are back in. Without the email, use the debug log or rename the plugins folder to find the cause.

    Is it safe to delete a plugin to fix the error?

    Deactivating is safer than deleting. Renaming the plugin's folder or using wp plugin deactivate stops it running but keeps its settings, so you can reactivate it once a fixed version is out. Deleting through the dashboard can also remove the plugin's data, depending on how the plugin was written.

    When should I ask my host for help?

    Ask your host if the debug log stays empty, if the error mentions memory limits you cannot raise, or if it started after a server change such as a PHP upgrade. Hosts can see server error logs, PHP settings and recent changes that site owners usually cannot.

    Get MaintainHQ updates

    Enjoyed this? Get new posts, Gus skills and WordPress maintenance tips by email. Roughly once a month, and you can unsubscribe at any time.

    Ready to try MaintainHQ?

    From £29 a month for up to 2 sites. Every plan starts with a 14-day trial.