Un mesaj de tipul “A apărut o eroare critică pe acest site web” în WordPress indică faptul că o problemă gravă împiedică încărcarea corectă a site-ului. Eroarea în sine nu este cauza – este pur și simplu WordPress care vă informează că ceva nu a funcționat corect.
Cauzele frecvente includ:
- Pluginuri incompatibile
- Conflicte între teme
- Fișiere WordPress corupte
- Erori PHP
- Probleme cu baza de date
- Depășirea limitelor de resurse ale serverului
Fortunately, in most cases the issue can be identified and resolved without rebuilding the website.
Table of Contents
Check Your WordPress Recovery Email
Since WordPress 5.2, the system automatically sends an email to the site administrator when a critical error occurs.
The email usually contains:
- Information about the affected plugin or theme
- Technical details about the error
- A special recovery mode link
Recovery Mode allows you to access the WordPress dashboard and temporarily disable problematic plugins or themes without affecting other website files.
Before performing any troubleshooting, check the administrator email account associated with your website.
Enable WordPress Debug Mode
If no recovery email was received, enabling debug mode can provide additional information.
- Connect to your website using FTP or your hosting file manager.
- Open the
wp-config.phpfile located in the WordPress root directory. - Locate the following line:
define('WP_DEBUG', false);
- Replace it with:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
- Save the file and refresh the website.
WordPress will create an error log located at:
/wp-content/debug.log
This file often contains the exact plugin, theme, or PHP file responsible for the problem.
Disable Recently Installed Plugins
Plugins are one of the most common causes of critical errors.
To test whether a plugin is responsible:
- Connect to the website via FTP or File Manager.
- Navigate to:
/wp-content/plugins/
- Rename the folder of a recently installed or updated plugin.
Example:
contact-form-7
to:
contact-form-7-disabled
- Reload the website.
If the site starts working again, the renamed plugin is likely causing the issue.
Switch to a Default Theme
A faulty or incompatible theme can also trigger critical errors.
To test this:
- Navigate to:
/wp-content/themes/
- Rename the active theme folder.
Example:
astra
to:
astra-disabled
- If a default WordPress theme such as Twenty Twenty-Four is installed, WordPress will automatically activate it.
If the website loads correctly afterward, the theme is likely the source of the problem.
Repair WordPress Core Files
Critical errors sometimes occur after incomplete WordPress updates or corrupted system files.
To repair WordPress:
- Download the latest version of WordPress from the official website.
- Extract the archive locally.
- Upload all files and folders except:
wp-content
wp-config.php
- Overwrite the existing files on the server.
This process refreshes WordPress core files without affecting your website content, plugins, themes, or settings.
Repair the Database
Database corruption can also cause critical errors.
To enable the WordPress database repair tool:
- Open the
wp-config.phpfile. - Add the following line:
define('WP_ALLOW_REPAIR', true);
- Open:
https://yourdomain.com/wp-admin/maint/repair.php
- Run the repair process.
After completion, remove the line from wp-config.php for security reasons.
Check Server Resource Limits
A website may display a critical error if it exceeds available server resources.
Common examples include:
- PHP memory exhaustion
- CPU limits
- Entry process limits
- PHP execution time limits
Check your hosting control panel or PHP error logs for messages such as:
Allowed memory size exhausted
Maximum execution time exceeded
If resource limits are causing the issue, increasing PHP limits or optimizing the website may resolve the problem.
How to Prevent Critical Errors
Although critical errors cannot always be avoided, the following practices can significantly reduce the risk:
- Create regular backups
- Update WordPress, plugins, and themes regularly
- Test updates on a staging environment when possible
- Install plugins only from trusted developers
- Remove unused plugins and themes
- Monitor PHP and server error logs
- Keep your PHP version up to date
Summary
A WordPress critical error is usually caused by a plugin conflict, theme issue, corrupted files, database problems, or insufficient server resources. The fastest way to identify the cause is to check the recovery email, enable WordPress debug mode, and review the generated error logs.
In most cases, the problem can be resolved by disabling a faulty plugin, switching themes, repairing WordPress files, or correcting a server configuration issue.