To get a clearer picture of what’s causing the error, you need to enable PHP error reporting. This can usually be done from your hosting control panel. Alternatively, you can manually enable it by adding these lines two files:
wp-config.php:
define(‘WP_DEBUG’, true);
define(‘WP_DEBUG_LOG’, true);
define(‘WP_DEBUG_DISPLAY’, true);
If you’re using an Apache server, add these lines to your .htaccess file:
php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on
After enabling error reporting, revisit your website. Instead of the generic “critical error” message, you should now see a specific error message, which can guide you to the root cause.
If the error points to a specific plugin or theme, try to deactivate the plugin or theme causing the issue. If you can’t access the backend, use an FTP client to rename the plugin or theme folder, which will disable it. Once disabled, check if there are updates available for the plugin or theme, as updates often include fixes for known issues.
If the error isn’t related to a plugin or theme, it might be an issue with the WordPress core files. You can safely reinstall them via SSH. Execute the following command in your public_html directory:
wp core download –skip-content –force
Disclaimer:
It’s important to note that using the wp core download –skip-content –force command is a safe operation for your website. This command specifically targets WordPress core system files for reinstallation. It does not affect your website’s content, such as images, posts, or pages, nor does it alter your installed plugins or themes.
-
This reply was modified 1 year ago by ignasp.