When creating a website on the popular WordPress CMS, you might encounter an error:
There has been a critical error on your website
- this error has code 500, meaning it's related to PHP code processing.
We have already described how to find the cause in this article: Error 500 on shared hosting — finding the cause. Using the guide at the link, you can identify the cause of the error for any PHP script.
In this guide, we will look at the most common causes of errors in the WordPress CMS and their quick resolution.
1. Error After Plugin Installation or Update
To accurately identify the error and the plugin causing it for the entire site, you need to disable plugins one by one. You should disable them by moving their folders out of the plugins
directory.
Create a temp
directory in the root of your site and move the plugin folder from httpdocs/plugins
as an example:
mkdir httpdocs/temp
mv httpdocs/plugins/some-plugin /httpdocs/temp
WordPress always looks in the plugins
folder; by moving a plugin's folder, you deactivate it. This makes it easier to find the one causing the error, especially if you updated multiple plugins simultaneously.
2. Error After WordPress Update
If WordPress is not updated for a long time, it becomes vulnerable, typically leading to issues like spam distribution, virus hosting, fake payment forms, etc.
2.1 Not Updated for an Extended Period
An error occurs after an update — the reason is that when you haven't updated it for a long time, the update skips intermediate versions that provided compatibility. For example, your WordPress might have been running on php 7.x
at the time of site creation, but after some time, the latest version is intended for php 8.4
, and WordPress itself, the theme, and plugins have undergone significant changes. In this case, updating directly to the latest version will lead to an error because the installation is incompatible with the older php
version.
In such a scenario, automatic updates for the site will not work. Manual, step-by-step updates with sequential PHP version upgrades in the hosting control panel will be required.
2.2 Plugin Incompatibility with New WordPress Version
If you regularly updated WordPress and an error occurred during a subsequent update, the reason might be incompatibility with versions of third-party plugins. Also, check the administration section for proper functioning, as well as the event log — the path to the file causing the error will be displayed there.
2.3 Other Reasons, for example:
- Lack of write permissions for certain files and folders
- Outdated PHP version
- New requirements for PHP or web server settings
In any case, before starting this type of work, it is necessary to create a website backup in the hosting control panel. If something goes wrong, you can always revert to the previous state.
If you haven't made a backup yourself, use the system backup; it's always available in the hosting control panel and doesn't consume your hosting plan's disk space. System backups are created once a month, replacing older ones, ensuring that one backup is always available, no older than one month.
You can configure your own regularly created backup. When configuring, keep in mind that frequent backups with replacement are not suitable for all projects, because if the site was showing an error for several days, a daily replacement backup will contain a non-working site, and without replacement, it will increase disk space consumption. Depending on the project, it's important to find your happy medium.
In conclusion, regular and timely updates allow you to keep WordPress and its modules up-to-date, maintaining a modern data structure. The WordPress Toolkit tool allows for more refined configuration of this CMS.