Skip to content
OSULZER.AT
WordPress11 min read· updated August 15, 2022

Fix "There has been a critical error on your website." - WordPress Guide

WordPress shows "There has been a critical error on your website"? Find the cause step by step with debug mode, FTP and the PHP settings and fix it.

You are probably pretty stressed right now because your WordPress site no longer works. Before we start, relax and take a deep breath. Drop the hurry and panic, you have come to the right place. From here on, we will work calmly and carefully.

Maybe you updated WordPress itself or a plugin, installed a theme, or even tinkered with the code yourself, and now nothing works. This article is all about how you can repair your WordPress installation. Of course, not every error can be described and fixed with a ready-made guide, because there are simply too many variables and sources of error. So if you cannot solve your problem on your own with the help of this article, I offer WordPress emergency support.

Terms and Tools You Need

In this article, words like FTP, phpMyAdmin, MySQL, or PHP will come up. Here is a short explanation of these terms:

FTP Access

FTP stands for File Transfer Protocol and, put simply, does nothing more than give you access to the folder where your website lives. A popular FTP tool, which I also used in this guide, is FileZilla. You can download it for free directly from the vendor, but be careful during installation, because additional software is unfortunately often installed along with it. You can deselect the additional software during installation, though. Mac users can switch to Cyberduck.

You get the login information you need for FTP access from your hosting provider. Basically, you need a server address, a username, and a password.

PHP

PHP is one of the programming languages WordPress was built with. PHP is executed by the server before your WordPress website is delivered. If a problem occurs during execution, your site is no longer displayed correctly.

MySQL

Among other things, your website stores data in a so-called MySQL database. You can think of MySQL as an organized archive that holds important settings and the text of your posts, products, or pages.

phpMyAdmin

You can visualize your database with tools like phpMyAdmin, and search and edit entries. Your hosting provider usually gives you access to phpMyAdmin directly. In your provider’s backend, look for the item “Database” or directly for “phpMyAdmin”.

First Step: Check Your Email Inbox

It sounds strange, but it is true. In recent months, WordPress has made improvements in the area of technical problems and implemented a new system that informs the site owner about problems by email. In case of a failure, an email with the subject “[Name of your website] has a technical issue” is sent, if still possible, and looks like this.

In this email, you will find the link to recovery mode, which may let you log in to your WordPress installation again. Click on this link now and log in with your normal credentials. If the error occurred in the frontend, a visit to the admin area can trigger the email. Experience has shown that the rescuing email often does not arrive at all, or recovery mode simply does not work. If you are lucky and can log in via recovery mode, just navigate to “Plugins” in the WP backend. The plugin that is causing problems should now be displayed there. Deactivate the plugin if possible or update it to the latest version. If possible, you could also delete it and install it again. If these steps do not help, you could also check the PHP version you are using and update it to a newer version if necessary. Otherwise, you can keep following this guide, and maybe one of the following points will help.

If none of this works, you can contact the developer of the plugin or, if you like, hire me to look into the matter in more detail.

Enable Debug Mode

By default, WordPress only shows us “user-friendly” errors. The actual technical problem responsible for the error is hidden. There are many reasons for this, one of them being security. In our case, however, that does not matter. We want to know exactly where the error is. For this, we have to enable so-called debug mode. It has to be enabled via FTP in the file wp-config.php. Use your preferred FTP client for this and edit the file. Below is a short series of images showing roughly how this works with FileZilla.

Now you may be asked for a preferred editor. In that case, it is best to choose the regular Notepad, or you can get something like Sublime Text. Never use Word, WordPad, or similar programs.

Once in the editor, we look for the line define( ‘WP_DEBUG’, false); and change it to define(‘WP_DEBUG’, true); Now we save the file and then confirm the change directly in FileZilla so that the change is uploaded.

Debug mode should now be active. If you now refresh your site, a more detailed error message should be displayed.

Interpreting Error Messages

Now it gets wild. When we refresh the page, we are presented with concrete error messages. The difficulty is figuring out what these messages actually tell you without programming knowledge. Let us look at a small example.

In this case, the debug output tells us that there is a syntax error on line 212 in the file at /wp-content/plugins/osulzer-custom/osulzer-custom.php. A syntax error basically means that a character is in a place where it should not be. For us, that is irrelevant, because at this point we only need the information about which plugin is causing the problem. In our case, it is a piece of software that normally never causes problems, of course, an in-house development of mine ( 😉 ). The faulty file is located in the folder “osulzer-custom”. If we deactivate this plugin, our site should be accessible again. But how exactly do we deactivate a plugin when we no longer have access to the WordPress backend?

Before we continue, do not forget to turn debug mode off again once you are done with your work.

Deactivating WordPress Plugins and Themes via FTP

You can deactivate all WordPress extensions using FTP access. Connect to your web space via FTP and navigate to the folder “wp-content”. Here we can jump into either the folder “plugins” or “themes”. In the example described above, the error was caused by a plugin, so we jump into the folder of that name. Once there, we look for the folder named “osulzer-custom”. This folder contains the file that caused all the headaches. To deactivate the plugin, we have to change the folder name. I have gotten into the habit of always putting a “_” in front of the name. So the folder “osulzer-custom” becomes “_osulzer-custom”.

With this trick, you can switch off every plugin and theme you use in your WordPress installation. In the worst case, you can use it to deactivate all plugins. In the case of themes, you should leave one of the preinstalled themes active, because otherwise your WordPress installation cannot output anything in the frontend.

Check the PHP Version in Use

If the problems with WordPress appeared right after updating one of your plugins, the error may be caused by an incompatible PHP version. To test this, you can log in to your hosting provider and look for a setting for the PHP version in use. At the time of this article, PHP 8.0 and, more recently, PHP 8.1 have been released. PHP 7.4 is still the most widespread version at the moment, though. If your website is currently still running on version 7.1, it is a good idea to update to 7.4 now. The reason you should not simply go for the newest version is compatibility with WordPress. Most problems can occur at the upper and lower ends of the PHP versions, so the golden middle should take priority when you are troubleshooting.

You can find an overview of the current PHP versions at: https://php.watch/versions

Increase the PHP Memory Limit

If the error on your website only occurs sporadically or suddenly appeared right after installing plugins such as WPML, the so-called PHP memory limit on your web server may be set too low. Especially with normal web hosting plans, the provider by default only gives you a small amount of memory for running PHP scripts. You can adjust the memory limit either directly with your hosting provider or via the wp-config.php file we already edited earlier.

Experience has shown that with 256MB of RAM available for running PHP scripts, you almost never have problems. If you have more memory available, or the option to assign higher values through your hosting provider, you can of course do that too.

To raise the WordPress PHP memory limit, go to the root directory of your WordPress installation via FTP as usual and edit the wp-config.php file. Directly below the entry “define( ‘DB_COLLATE’, ‘’ );”, add the following line:

define( 'WP_MEMORY_LIMIT', '256M' );

The amount of available memory is not completely irrelevant, though. The memory limit can also be seen as a kind of upper limit for your WordPress installation if something goes wrong or your site gets hacked and misused for other purposes.

A Plugin or Theme Still Causes Problems, What Now?

Once the culprit has been identified, you can proceed in a fairly targeted way from here on. If the problems appeared after an update, the latest version you are now using may have a problem. In that case, you can contact the developer, for example. For plugins downloaded directly from the WordPress plugin directory, the plugin’s detail page has a “Support” item. There you can talk to other users of the plugin in a forum. You should also find the developer’s contact details on this page. There may already be people in the forum who have exactly the same problem as you. Ideally, you would find the previous version of the plugin and install it manually. In your search, though, be meticulous about downloading plugins only from the official sites of the respective developer. Never install plugins offered on sites you are not 100% sure are legitimate. In the worst case, you install a plugin with a nice backdoor and a few hours later you have the next, most likely much worse problem on your hands.

Unfortunately, it happens again and again that WordPress plugins are no longer developed further and thus become incompatible with new versions of WordPress. In that case, you will have little luck writing to the plugin’s developer and will have to look for an alternative whether you like it or not. Maybe you will get lucky and find an alternative solution in the huge ecosystem around WordPress.

Tips for the Future

If you managed to bring your site back to life, you may be wondering what you can do better in the future to be better prepared for problem scenarios. Creating a backup before you make changes to your site is especially recommended. You can create backups manually via FTP and phpMyAdmin, possibly directly through your hosting provider, or, if you prefer, through a WordPress plugin. I like to use UpdraftPlus myself. In the free version, you can create a backup of your site at the push of a button that secures your database, plugins, and themes. The backups are stored in the wp-content folder.

The optimal workflow for the future would therefore be:

  1. Create a complete backup of the site and download it
  2. Make changes
  3. If there are problems, restore the backup

With this workflow, you are prepared for an emergency in the future.

Nothing Worked, What Else Can I Do?

You are welcome to contact me directly with your problem. You can find all the information about my offering on the page “WordPress emergency help”. If the error is in a custom plugin or the theme, I fix it directly in the code as a WordPress programmer in Vienna.

WordPress Emergency Help

Cannot solve the problem yourself?

I repair your WordPress website - from €240, and you pay only once it is running again.

Get emergency help

New project?

Contact.

Tell me briefly about your project - I'll get back to you personally.

Your data is used solely to handle your inquiry. More in the privacy policy.