What Actually Causes WordPress “Critical Errors”

blog / What Actually Causes WordPress “Critical Errors”

The “There has been a critical error on this website” message is one of the most disruptive errors a WordPress site can experience because it often takes down both the front-end and the admin area at the same time. From a user perspective, the site simply stops working. From a technical perspective, what has happened is that PHP encountered a fatal error and stopped execution before WordPress could finish loading.

This error is often associated with plugin updates, theme changes, PHP version upgrades, or server configuration changes, but the root cause is almost always one of a few technical issues: memory exhaustion, fatal PHP errors, plugin or theme conflicts, or database failures.

Understanding the actual technical causes behind this error is important because the visible message WordPress shows is generic, but the real error is almost always recorded in logs. Once you know where to look and what typically causes these failures, diagnosing the issue becomes much more systematic and much less guesswork.

How the System Works

To understand why a critical error happens, it helps to understand what happens during a normal WordPress page load.

When someone visits a WordPress page, the server does roughly the following:

  1. The web server (Nginx or Apache) receives the request.
  2. PHP starts executing and loads WordPress core files.
  3. WordPress loads configuration from wp-config.php.
  4. WordPress loads all active plugins.
  5. WordPress loads the active theme and its functions.php.
  6. WordPress runs hooks and filters registered by plugins and themes.
  7. WordPress runs database queries to fetch content.
  8. WordPress renders the page.
  9. The server sends HTML to the browser.

If a fatal PHP error happens anywhere between steps 2 and 8, PHP stops immediately. WordPress never finishes loading, and instead of a page, the system displays the “critical error” message.

So the important thing to understand is this:

A WordPress critical error is almost always a PHP fatal error that stopped execution.

The job when debugging is not to “fix WordPress”, but to find what caused PHP to stop.

Where Problems Start Appearing

Problem #1: PHP Memory Limit Exhausted

This is one of the most common causes, especially on WooCommerce sites or sites with many plugins.

Typical error behind the scenes:

Fatal error: Allowed memory size of 268435456 bytes exhausted

This means a PHP script tried to use more memory than the server allows.

Common causes of memory exhaustion:

  • Large WooCommerce imports
  • Backup plugins generating large zip files
  • Image resizing and processing
  • Plugins loading large datasets into arrays
  • Very large autoloaded options
  • Poorly written loops that keep adding data to memory
  • Page builders rendering very large layouts
  • Reports or exports that load thousands of records at once

Many people “fix” this by increasing memory:

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

Sometimes this is necessary, but increasing memory is often just delaying the problem. If a plugin is using 500MB of memory to generate a page, the real issue is the plugin behavior, not the memory limit itself.

Problem #2: Plugin Conflicts

Plugin conflicts are another major cause of critical errors, especially after updates.

Common technical causes:

  • Two plugins declaring the same function
  • Two plugins loading different versions of the same library
  • A plugin update changes a function name or removes a function another plugin relies on
  • A plugin expects a specific PHP version
  • A plugin expects a function from another plugin that is no longer active

Typical fatal errors look like this:

Fatal error: Cannot redeclare function my_function()

or

Fatal error: Uncaught Error: Call to undefined function plugin_function()

These errors occur during the plugin loading phase, which happens before the page renders, which is why the entire site goes down.

This is also why many critical errors happen immediately after plugin updates.

Problem #3: Theme-Level Fatal Errors

Themes are not just design — many themes contain significant logic in functions.php and included files. If a theme file contains a fatal error, WordPress cannot load the theme, and the site crashes.

Examples of common theme-related fatal errors:

  • Calling a function that does not exist
  • Including a file that does not exist
  • Syntax errors after manual code edits
  • Using PHP functions not supported by the server PHP version
  • Infinite loops or recursive functions

Example:

require_once get_template_directory() . ‘/includes/custom-functions.php’;

If that file is missing, the site crashes immediately.

Another common issue is undefined variables or objects used in hooks that run globally across the site.

Problem #4: PHP Version Mismatch

This happens more often than people expect.

Typical scenario:

  • Hosting provider upgrades PHP from 7.4 → 8.1
  • Older plugin or theme uses deprecated PHP functions
  • Fatal error occurs immediately on load

Example errors:

Fatal error: Uncaught Error: Call to undefined function each()

or

Fatal error: Array and string offset access syntax with curly braces is no longer supported

These are not WordPress errors — they are PHP compatibility errors.

This is why PHP upgrades should always be tested in staging first.

Problem #5: Database Errors

Some critical errors are actually database-related issues that stop WordPress from loading properly.

Examples:

  • Database connection failure
  • Corrupted tables
  • Missing tables after migration
  • Plugin expecting a table that was not created
  • Very large queries timing out
  • Database user permission issues

Typical messages:

Error establishing a database connection

or

WordPress database error: Table ‘wp_plugin_table’ doesn’t exist

If a plugin tries to query a table that does not exist, it can cause a fatal error depending on how the plugin is written.

Deep Dive: Autoloaded Options and Memory Usage

One of the least known causes of memory-related critical errors is autoloaded options.

WordPress stores settings in the wp_options table. Some of these options are marked as autoload = yes, which means WordPress loads them on every single request, before anything else happens.

If plugins store large serialized arrays in autoloaded options, memory usage increases on every request.

You can measure autoload size with this query:

SELECT SUM(LENGTH(option_value)) as autoload_size
FROM wp_options
WHERE autoload = ‘yes’;

If this number is:

  • Under 1MB → Normal
  • 1–3MB → Starting to get heavy
  • 3–10MB → Performance and memory issues likely
  • 10MB+ → High risk of memory errors

Large autoloaded options often come from:

  • Page builders
  • Security plugins
  • SEO plugins
  • Backup plugins
  • WooCommerce session data
  • Logging plugins

The fix is not increasing memory — the fix is reducing what is autoloaded.

How to Measure / Diagnose

The most important step when a critical error happens is to find the real PHP error.

Enable debugging:

define(‘WP_DEBUG’, true);
define(‘WP_DEBUG_LOG’, true);
define(‘WP_DEBUG_DISPLAY’, false);

Then check:

/wp-content/debug.log

Also check server logs:

  • /var/log/nginx/error.log
  • /var/log/apache2/error.log
  • PHP-FPM logs

These logs usually tell you:

  • Which file caused the error
  • Which plugin or theme caused it
  • Which line number caused it
  • What type of error occurred

Once you have that information, the problem becomes much easier to fix.

If admin is inaccessible, you can disable plugins via FTP by renaming the plugin folder:

/wp-content/plugins/plugin-name → plugin-name-disabled

Or using WP-CLI:

wp plugin deactivate plugin-name

Tradeoffs and When Not To Overreact

A single critical error does not necessarily mean the site is poorly built. Sometimes it is simply caused by:

  • A plugin update that introduced a bug
  • A temporary memory spike
  • A hosting change
  • A failed update process
  • A file upload that exceeded limits

However, repeated critical errors usually indicate deeper issues:

  • Too many heavy plugins
  • No staging environment
  • Updates applied directly to production
  • Hosting with low memory limits
  • No monitoring or alerting
  • No backup strategy
  • No update testing process

At that point, the issue is not just fixing the error — it’s improving the stability of the environment.

Practical Checklist

When a WordPress critical error happens:

  • Check debug.log
  • Check server error logs
  • Identify which plugin/theme/file caused the error
  • Disable the problematic plugin via FTP or WP-CLI
  • Check PHP version compatibility
  • Check memory usage and memory limit
  • Check autoloaded options size
  • Verify database tables and database connection
  • Restore from backup if necessary
  • Test updates in staging before applying to production
  • Monitor logs after the fix

Closing Technical Insight

Most WordPress critical errors come down to a small number of technical causes:

  • Memory exhaustion
  • Plugin conflicts
  • Theme-level fatal errors
  • PHP version incompatibility
  • Database failures

The WordPress error message itself is generic, but the real cause is almost always recorded in logs. In practice, the difference between a 10-minute fix and several hours of downtime is usually whether logging, backups, and a staging environment were in place before the error occurred.

From a technical standpoint, stability in WordPress sites is less about avoiding updates and more about controlling the environment in which updates, plugins, and code changes are introduced.