WordPress There has been a critical error on this website

WordPress Tips

If you’ve done updates on your WordPress plugins, you’ve probably hit this error a few times:

There has been a critical error on this website. Please check your site admin email inbox for instructions.

What do you do when you see this error in WordPress?

The first thing is to NOT panic. This is a common error. It means one of your plugins went awry when doing its update.

Usually it’s clear which plugin you were just working on. If you were doing a bulk update of plugins, it might be trickier to narrow down which one is causing the problem.

The easiest way to get a hold of this problem is to FTP or somehow access the files on your server. Go into the plugins folder and rename the plugin folder in question to something else. That will prevent it from loading. If you don’t know which one is causing the problem, simply rename them ALL to something else for now and then do the process of elimination, re-naming them one by one to see where things get stuck.

If you can’t get to the files, but you can get to the database, look for the table wp_options. In that table find active_plugins. Change its value to a:0:{} – you can do this with:

update wp_options set option_value = ‘a:0:{}’ where option_name = ‘active_plugins’;

That will turn off all plugins for now in the database. That way you can reload your admin area. Again, start re-activating your plugins one by one until you hit the one that causes a problem.

When you have a plugin with an issue, try reinstalling it from scratch. If that doesn’t work, contact the plugin owner.

What If Deleting the Plugins Doesn’t Work?

Sometimes, even deleting the plugin files doesn’t fix the problem. If you look in the error log, you might see issues like:

Cannot redeclare get_page_by_title()

If you see strange errors, it most likely means you were doing an update and it timed out partway through. You now have your WordPress site half in the old version and half in the new version.

DO NOT DELETE YOUR FILES.

Here is what to do.

BACK UP ALL EXISTING FILES. Always an important first step.

Go to the official WordPress site and download the latest version of WordPress. The one you were trying to update to.

Unzip those files on your local machine.

Remove / Rename the ‘content’ directory. Our aim is not to replace existing content in WordPress. It’s just to re-update all the actual working files.

Now you can either ZIP up those files and move them to your server or you can FTP them as raw files, whichever works for the type of access you have. Your end goal is to overwrite all existing files with these new files – just not the /content directory.

Once you do that, you will have all the files in the new, current state. That should fix the problem.

Good luck!

1 Trackback / Pingback

  1. Updating Failed – WordPress Error – ASP Is Fun

Leave a Reply

Your email address will not be published.


*