WordPress critical error message means that PHP in your site's code has stopped working and cannot render the page. Behind the message "A critical error has occurred on this website" there is often a plugin, theme file, or line of code that is incompatible with the PHP version. The first step to the solution is not to guess, but to see exactly which file the error occurs in.

When does a critical error occur?

This message replaces the old "white screen" error. WordPress The protection introduced in 5.2 shows this notification instead of a blank page when it catches a fatal PHP error. The most common triggers are:

  • Incompatibility that occurs after a plugin or theme update.
  • Upgrading PHP on the hosting side.
  • An incorrect piece of code manually added to the functions.php file.
  • Out of memory or a missing PHP plugin.

For the old-school blank page problem WordPress white screen error Our guide follows the same logic.

Step 1: Check recovery mode email

WordPress sends a notification to the administrator email address when it detects a critical error. This email tells you which plugin or theme is causing the error and includes a link to a recovery mode. When you enter the panel with the link, the problematic plugin will be disabled only for your session; You can also turn off the plugin and fix the site for visitors.

Step 2: Open the error log

If the e-mail is not received, you open the error report yourself. Via FTP or hosting file manager wp-config.php Open the file and add these lines above the "You're done editing" comment:

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

The first line turns on debugging. Second line errors wp-content/debug.log writes to file. The third line prevents errors from being displayed to the visitor. Refresh the site once and read the last lines of the debug.log file. The line starting with "PHP Fatal error" gives the file path and line number of the error. For detailed use WordPress debug You can look at our article.

Step 3: Comment out the file path in the record

The file path directly points to the culprit. The table below summarizes our most common paths and the work to be done:

Path in recordMeaningwork to be done
wp-content/plugins/plugin-name/The error is in that pluginClose by changing the name of the plugin folder
wp-content/themes/tema-adi/functions.phpIn the theme or added codeRevert last added code or switch to default theme
wp-includes/ or wp-admin/Kernel file is corruptReinstall WordPress kernel from official package
Allowed memory you exhaustedout of memoryIncrease WP_MEMORY_LIMIT, find problematic plugin

Step 4: Close the plugin via FTP

If you cannot enter the panel, you close the plugin at the file level. wp-content/plugins the name of the relevant folder in it, for example eklenti-adi-kapali Just do it. WordPress disables the plugin when it cannot find the folder. If the site opens, the problem is in that plugin; Wait for the updated version or switch to an equivalent plugin. If no plugin is responsible, change the name of the theme folder to the default theme.

Step 5: Close error logging after resolution

When the problem is solved WP_DEBUG Set its value to false and delete the debug.log file. The log file left open grows over time and carries the risk of revealing information such as the server path.

What to do to avoid critical error?

Most critical errors occur after updates and can be prevented to a large extent by taking a few precautions in advance. Instead of bulking out updates on the live site, try them on a test copy first. Make a full backup before every update so that if a problem occurs, you can roll back within minutes. If the PHP version will be upgraded, check the developer notes that the plugin and theme support that version. If you need to add code to the functions.php file, use a small plugin or snippet tool instead of directly in the theme file; In this case, the faulty code is disabled by simply closing that widget.

For example, in a store that takes orders every day, it is much safer to make updates on Monday morning, when traffic is low, and after testing, than to spend the weekend with a critical error with a mass update on Friday evening. A five-minute post-update checklist is also useful: does the home page, a product or article page, a contact form, and a checkout step open?

Common mistakes

  • Deleting all plugins at once: Settings are lost; changing the folder name gives the same result reversibly.
  • Forgetting the error log open: It causes security and disk problems.
  • Randomly downgrading PHP: It opens the site in the short term, but reverts it to the version with no security support.

If the critical error repeats or the recording is incomprehensible WordPress technical support Our team finds the error at its source and solves it permanently.

What should I do if I haven't received a critical error email?

Email sending may not be working on the site. In this case, open the error log via wp-config.php and read the debug.log file directly.

Will a critical error delete my data?

No. The message indicates that PHP has stopped working; Your content stays in the database.

Does the recovery mode connection expire?

Yes, the link is valid for a short time. If the time has expired, error recording and plugin closure method via FTP are used.