“Fatal error: Uncaught Error”
PHP, the language WP runs on, hit code it couldn't run. Get your site back by hand first. Then add the plugin so next time it finds the cause.
Is your site down right now?
- Check your site's admin email inbox. WP sends “Your Site is Experiencing a Technical Issue” naming the plugin or theme that crashed.
- Open the email's link and log in. Go to Plugins and press Deactivate under the plugin it names.
- No email? In your host's file manager, open wp-config.php. Above “That's all, stop editing!” add: define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true );
- Reload the page, then open wp-content/debug.log. The last “PHP Fatal error” line names a folder in wp-content/plugins or wp-content/themes.
- Rename that folder, for example add -off to its name. WP stops loading it. Then remove the 2 lines you added.
CMSHands can't be installed into a site that won't load. These steps come first.
A person approves every repair. Install it before anything breaks.
Needs WP 6.3 to 7.1 and PHP 8.0 or newer. What it installs
Needs WP 6.3 to 7.1, PHP 8.0 or newer, and an administrator login. One site per install.
The download is a plugin. Turning it on connects your site to cmshands.com and adds 3 small rescue files. Deleting the plugin removes them and everything it stored. What we send
Plugins are installed from a computer. Get the plugin here instead
- No account, no password to share
What it means
“Fatal error” means PHP hit code it couldn't run and stopped building the page. PHP is the language WP runs on; your host sets its version.
- A plugin calls a function that isn't there, often after an update, or when a plugin it needs is switched off.
- 2 plugins, or a plugin and your theme, use the same function name. The error says “Cannot redeclare”.
- Your theme's functions.php has a mistake, often from code pasted in from a tutorial.
- Your host moved to a newer PHP version that an old plugin or theme can't run on.
- A page used more memory than PHP allows: “Allowed memory size … exhausted”.
- A page took longer than your host allows: “Maximum execution time … exceeded”.
- A plugin update stopped halfway and left some of its files missing.
How to read the message
A full fatal error line has 3 parts. First comes what went wrong, such as “Uncaught Error: Call to undefined function”. Then the file, then the line number after a colon.
The file path is your best clue. A path with wp-content/plugins/ points to the plugin whose folder comes next. A path with wp-content/themes/ points to your theme.
A path with wp-includes or wp-admin is WP itself, and WP is rarely the cause. Look down the lines under “Stack trace” for the first plugin or theme folder.
Where do you see it? With debugging off, visitors only see “There has been a critical error on this website.” The full line goes to your error log.
Many hosts show that log in their control panel, often under Logs. Or turn on WP's own log with the 2 lines from the steps above, then open wp-content/debug.log.
Fix it by cause
A plugin
Switch it off in Plugins › Installed Plugins: press Deactivate under it. If you can't log in, rename its folder in wp-content/plugins instead.
Then see if an update fixes it, or go back to the version that worked. The plugin's support forum on wordpress.org often has others reporting the same line.
A “Cannot redeclare” error names 2 files. Those are the 2 plugins that clash. Keep the one you need, and look for an update of the other.
Your theme
Rename your theme's folder in wp-content/themes. WP can't find it, so it switches to a default theme, such as Twenty Twenty-Five, if one is installed.
Did the error start after an edit to functions.php? Put back your copy of that file, or undo the edit in the file manager. Then switch back in Appearance › Themes.
A new PHP version
Did the error start the day your host changed PHP? Then an old plugin or theme can't run on the new version.
Ask your host to set the old version back for now. Then update the plugin, or find one that's still kept up to date.
Memory or time
“Allowed memory size … exhausted” means a page used more memory than PHP allows. Add define( 'WP_MEMORY_LIMIT', '256M' ); to wp-config.php, above “That's all, stop editing!”. Some hosts cap it lower, so ask yours.
If it comes back at a higher limit, a plugin is using too much. Switch plugins off one at a time to find it.
“Maximum execution time … exceeded” means a page took longer than your host allows. It's often a big import or a slow outside service. Ask your host what the limit is before you raise it.
A half-finished update
If an update stopped halfway, the plugin's files don't match. Rename its folder, then install it again from Plugins. Its settings stay in your database.
Stop it coming back
Update one plugin at a time and open your site after each. If it breaks, you know which one did it.
Keep Administration Email Address in Settings › General on an inbox you read. That's where WP sends the link that lets you log in with the broken plugin paused.
Keep a copy of functions.php and wp-config.php before you edit them. A copy on your computer is enough to put them back.
When you're done, remove the 2 debug lines from wp-config.php. Otherwise the log keeps growing, and on many hosts anyone can open it at yoursite.com/wp-content/debug.log.
Next time
- On a site that had CMSHands before it broke, it reads your error log and settings to find the cause.
- We prepare the fix; a person at CMSHands approves it before it runs. Tried on our test sites; hosts differ.
- It checks your site once a day on the free plan, and at once when a crash is reported.
More it does here (1)
- Once your site loads, the chat says in plain English what happened. Email needs your address.
Why it won't wreck your site
- A person checks every repair. When your site is down you can't reach the chat, so a person at CMSHands approves the fix before it runs.
- It checks your pages after the fix. It loads your home page, login, dashboard and a post again before it calls the repair done.
What it won't do here
- It can't be installed into a site that is already down.A plugin can't be added to a dashboard that won't load. Get your site back with the steps above, then install it.
- A person approves every repairNothing in a repair runs until a person at CMSHands has checked it. It doesn't repair your site on its own.
- It can't change your PHP versionYour host sets the PHP version, in their control panel or when you ask.
- It can't clean up a hacked siteIf the fatal error comes from code someone slipped onto your site, talk to your host.
Questions
What does a fatal error mean in WordPress?
It means PHP stopped building the page because it hit code it couldn't run. The rest of the page never loads. Visitors usually see “There has been a critical error on this website.” instead. The full line, with the file and the line number, is in your error log.
How do I fix a fatal error caused by a plugin?
Switch the plugin off. If you can log in, go to Plugins and press Deactivate under it. If you can't, rename its folder in wp-content/plugins with your host's file manager. Then update it, go back to the version that worked, or ask its author for a fix.
How do I fix a fatal error caused by my theme?
Rename your theme's folder in wp-content/themes. WP then switches to a default theme, if one is installed, and your site loads. If the error started after an edit to functions.php, put back your copy of that file. Fix or update the theme before you switch back in Appearance › Themes.
Where do I find the full fatal error message?
In your error log. Many hosts show it in their control panel, often under Logs. Or add define( 'WP_DEBUG', true ); and define( 'WP_DEBUG_LOG', true ); to wp-config.php, reload the page, and open wp-content/debug.log. Remove the 2 lines when you're done.
Can CMSHands fix a fatal error on my site?
Not if your site is already down without it: it can't be installed into a dashboard that won't load. On a site that had it before the crash, it finds the cause and prepares the fix. A person at CMSHands approves the fix before it runs. Tried on our test sites; hosts differ.
Written by CMSHands team.
Be ready for the next one
- A person approves every repair
- No account, no password to share