web analytics
Quick Inquiry
Quick Inquiry




    Fixing “There has been a critical error on this website” In WordPress: 5 Easy Methods

    Fixing “There has been a critical error on this website” In WordPress: 5 Easy Methods

    The significant rise in WordPress development is attributed to its flexibility, ease of use, open-source nature, scalability, and many more. Also, WordPress does have a learning curve. If you are an admin using WordPress for your website, encountering errors is normal. You can face message like “There has been a critical error on this website” that can block you from your website even with admin access.

    This can be frustrating, especially during a vital website update or when publishing core content. Fortunately, there is a fix. For example, you can switch conflicting plugins to resolve this error. Another way is to check PHP errors that cause such issues and rectify them.

    This article focuses on ways to fix “There has been a critical error on this website” and its roots. But first let’s check out the causes of this error.

    What causes the “There has been a critical error on this website” error?

    The error message “There has been a critical error on this website” can be caused by various reason such as overloaded memory, database corruption, or outdated plugins. However, understanding what this error is first makes more sense.

    Such a message occurs due to a WordPress error in your site. Most significantly, admins can’t access the site until and unless specific actions are taken. Here is the brief of each reason that cause the error.

    1.) WordPress Core File Issues

    WordPress files can become corrupted over time, causing issues such as “There has been a critical error on this website?” The file can also be debased or absent, so there have been fewer regular WordPress updates.

    2.) Plugin Malfunctions

    WordPress websites can have corrupted theme files and outdated plugins that malfunction, creating error messages. The best practice is to remove such plugins or a theme from your website.

    3.) Syntax Errors

    Websites with custom codes can lead to such issues. While customized websites do improve personalization and user experience, they also break the PHP code executions. Plus, custom code also has plugin conflicts causing such error messages.

     4.) PHP Memory Limits

    PHP memory limit can cause such error message. It is the maximum amount of memory a PHP script can use. Default value for the PHP memory is 128 MB. So, if a PHP script crosses the memory usage limit, it can cause error message.

     5.) Ready-Made Code Snippets

    If you use ready-made code snippets for your website from open-source libraries, it can lead to such error messages. Many of these code snippets can be infectious due to code injections.

    Due to inherent vulnerabilities of such code snippets your WordPress website may show error message.

    These are the causes for “There has been a critical error on this website.” In WordPress. Now that you know the causes, it’s time to analyse some possible solutions.

    How to fix the “There has been a critical error on this website” error?

    WordPress does provide an email about the error. You can use this email to understand the cause and nature of the error. But if you didn’t get the email, we have mentioned the top five methods to fix “There has been a critical error on this website” in WordPress.

    1.) Check Error Logs

    PHP errors may be responsible for error “There has been a critical error on this website” In WordPress. Finding and fixing the PHP error information is easy if you can access log files. You can use the FTP client’s file manager to access the error log file. Here is how,

    • Use your FTP client to connect to the server where your website is hosted.
    • Ensure you are using an SFTP or Shell user account.
    • Navigate to the /logs directory (The exact path may vary depending on your hosting provider)
    • Navigate into the directory for the site you want to check inside the /logs directory.
    • Right-click on the file named error.log and select “Open with” to view the contents in a text editor.

    There are four different types of errors: warning, notice, parse, and fatal. If you find a fatal or parse error, it will need fixing.

    2.) Debug Your WordPress

    When you enable debug mode in WordPress can aid to fix the “There has been a critical error on this website” error.

    Here is a step-by-step process,

    1. Connect with the FTP server and find the PHP configuration file (wp-config.php)
    2. You will find the config file in the root folder, just open it in a text editor.
      config file in the root folder WordPress
    3. Place the debug code at the bottom
      Debug code:

      define( 'WP_DEBUG', true ); 
      define( 'WP_DEBUG_DISPLAY', false ); 
      define( 'WP_DEBUG_LOG', true ); 
      

      This will enable the debug mode in WordPress, allowing you to analyze the errors written in the debug.log.

    3.) Check Your Plugins and Themes

    Plugins and themes can be outdated, causing the “There has been a critical error on this website” error. Significantly, if security patches are not updated for the plugins or there are configuration conflicts, it can cause errors. So, first, you need to check all the WordPress plugins and theme you use.

    Theme Conflict and Solution

    To check whether it’s a theme conflicts with your site, you need to turn off active theme on the website. You can turn it off by going to public_html and finding themes under the WP content folder.

    Rename the active theme folder to “youractivetheme-disabled.” Similarly, you can turn off conflicting plugins, too.

    Plugin Conflict and Solution

    Plugin conflicts occur due to compatibility issues. WordPress has a huge storage of plugins.

    However, not all plugins work well together and this is where the conflict arise. So if you are using two plugins and both change the same database table it can cause an error message.

    You can disable plugins and check which one of them is causing conflict. Now with your hosting panel, disabling plugins will require you to access the security section of WordPress.

    Once you turn off all plugins, refresh the site and see if it loads seamlessly. Another way is to deactivate plugins manually. This will only work if your admin side working. To do it, click on plugin tab and find the plugin you want to deactivate.

    WordPress Admin Plugin Screen

    Click on “Deactivate.” You can also delete the plugin from your site by clicking on bulk actions and choosing to delete all the selected plugins.

    WordPress Admin Plugin Deactivate Screen

    Knowing the plugins that cause the conflict will require reactivating each and refreshing the website each time. However, sometimes, it’s not just about plugins or themes but the kind of memory they consume.

    Optimize PHP Memory

    PHP memory can have restrictions set by WordPress. You want to reduce the overload and increase the memory limit, then modify the configuration file using a file manager in the hosting control panel. First, access your website’s php.ini file and add the following line of code.

    memory_limit = 256M

    If you don’t have access to the php.ini file of your website you can add the following code in your wp-config.php file,

    define(‘WP_MEMORY_LIMIT’, ‘256M’);

    Clear Cache

    This approach may seem cliché, but it still helps fix the “there has been a crucial error on this website” error in WordPress. Clearing the cache can help restore the website, which worked well before the browser cached it.

    After the cache is cleared, the cached version of your site will be restored, allowing rapid reload. Clearing your cache will also remove all the corrupted files stored during the caching.

    Conclusion

    These days, WordPress websites are popular; yet, they have a lot of shortcomings, and occasionally you may encounter issues, which can be annoying.

    Without a doubt, they are readily resolved with a few quick procedures, such as memory checks, theme and plugin checks, and other methods covered in this blog post.

    Whatever approach you take, the outcome will depend on what caused WordPress to report, “There has been a crucial error on this website.” It is thus important essential to decide the error’s cause before fixing it.