
How to Fix the “There Has Been a Critical Error on Your Website” WordPress Error
There a time when your wordpress wesite may crash with an error
“There Has Been a Critical Error on Your Website” error that you dont have access to the backend , This error mainly occurs due to plugins, themes and wordpress core files being corrupted. The good news is that this can be fixed, if you have access to a terminal in your server . If you are on cpanel you may need to copy a new wodpress core installation files , keeping in mind not to update the wp_content files since this are where your website content reside, Only update the other worpress files and folders.


Follow these steps on your server terminal . Assuming your website is located on /var/www/website
1. Reinstall WordPress Core Files (Without Affecting Content)
Run the following command to reinstall WordPress core files at /var/www/website
without affecting content:
wp core download --skip-content --force --allow-root --path=/var/www/website
2. Update WordPress Core
wp core update --allow-root --path=/var/www/website
3. Update All Plugins
wp plugin update --all --allow-root --path=/var/www/website
4. Update All Themes
wp theme update --all --allow-root --path=/var/www/website
5. Activate All Plugins
wp plugin activate --all --allow-root --path=/var/www/website
6. Set Correct Permissions
Ensure correct file and folder permissions:
chown -R apache:apache /var/www/website
find /var/www/website -type d -exec chmod 755 {} \;
find /var/www/website -type f -exec chmod 644 {} \;
Restart Apache:
systemctl restart httpd
7. Verify Installation
Check the WordPress version:
wp core version --allow-root --path=/var/www/ruwebsite
