How to fix there has been a critical error on this website in WordPress



In this tutorial, we will know, how to fix when you get an error on your website "there has been a critical error on this website "


When you got this message on your website, that means there is some error from PHP. As you know the backend of the WordPress website works with PHP, But by default, WordPress is not showing PHP errors to your visitor. So to check the PHP error in your website you must enable debug mode of WordPress.


Let's know how to enable debug mode in WordPress Website


To enable debug mode, we must login Control panel Web Eye Soft control panel ( based on Directadmin Panel )
To know how to login control panel , please check this tutorial How to Login your Web Hosting control Panel


Seems now you successfully login to your control panel. Now you need to click file manager . below your can see file manager on each control panel like cPanel , Web Eye Soft Control panel , CWP panel , Direct Admin panel

login control panel to Open file manager


Now Need to open file wp-config.php and edit. Change debug mode false to ture as like screenshot


Note: as per domain you need find wp-config.php in your file manager

Edit wp-config to start debug

Now you need to check your website, Now you can see the actual error of PHP. So as per the PHP error, you need to take action.

Here is give a few examples of errors and solutions for that. In your case, it can be another issue.

Sometimes you go error PHP Fatal error: with the location where and what is the issue.

Php error after debug WordPress

In my case, I can see a theme has an error. You need to ask your developer to check and fix it. But to make it live, I just deactivated that theme or plugin and try to open the website. So I again go to file manager and rename the theme or plugin. Then I will check.

Deactive WordPress plugin and theme from file manager

If you see the website working, then great.
If you can see a black screen, You need to login to your WordPress admin panel yourdomain.com/wp-admin. when installing a theme or changing a theme.

Some case, Error come from wp-admin . wp-include folder , then you need to reinstall WordPress core file .

Take a backup
Then create a folder with name backup and move all files and folders except wp-config[dot]php file and wp-content folder . Then download a wordpress from this link https://wordpress.org/download/ then upload to under public_HTML folder , Once upload extract that files . You can see now a wordpress folder . Move all file wordpress folder to public_html folder except wp-config[dot]php file and wp-content folder . For htaccess create you can check this website https://wordpress.org/support/article/htaccess/
Or
You can re-generate htaccess from wordpress admin panel . Login WP-admin then go to general Settings > Permalinks.-> and click on save button Then check website .


Here is video for to get live example

4.7/5
 Web eye soft Review on Google

In order to optimally design our website and to show appropriate offers we are using cookies. By continuing to use our website you agree that we set cookies. More information