Skip to content

Fixing Common WordPress Errors: The White Screen and the 500 Error

A practical guide to fixing common WordPress errors: the white screen of death (WSOD), the 500 error, the database connection error, exceeding the memory limit and .htaccess errors — how to enable WP_DEBUG and read the error log, isolate the cause (plugin/theme/memory), and fix it step by step, plus prevention.

WordPressسارة خليل32 min read
Illustration of a blank white browser screen with a warning sign and a wrench, representing fixing common website errors
On this page

One day you stop work to open your site and are greeted by a blank white page with no message at all, or by the curt phrase "There has been a critical error on this website." It is a frightening moment, especially if the site is your source of income. But the reassuring news is that WordPress errors — despite their catastrophic look — can be diagnosed and fixed with an organized method, and they rarely mean losing your data. The difference between someone who fixes the problem in minutes and someone who spends hours panicking is having a clear diagnostic method instead of random trial and error.

This reference guide takes you step by step through the most common WordPress errors, their causes and their fixes, with ready-to-use code, reference tables and checklists. Read it once in full to understand the method, then use it as a reference to come back to whenever something breaks. And if you are new to the platform, start with the complete WordPress guide to build the foundation, then come back here at the first failure.

What is the general philosophy for fixing any WordPress error?

Before any fix, take in the golden rule: don't guess, diagnose. Every fatal WordPress error has a specific cause written down somewhere — in the error log, in the recovery mode message, or in the site's own behavior. Your job is to uncover that cause before you touch any file. Random edits to wp-config.php or deleting files without understanding them can turn a simple failure into a real disaster.

The method we follow throughout this guide is five steps in order; don't skip any of them:

  1. An immediate backup — before any change, save a copy of the files and the database. If things get worse, you go back to it.
  2. Enable WP_DEBUG and read debug.log — this makes WordPress print/log the cause of the failure instead of hiding it behind a white screen.
  3. Isolate the cause by elimination — disable plugins, switch to a default theme, raise memory, regenerate .htaccess — one at a time until the site comes back.
  4. Fix — once you have identified the culprit, fix, replace or delete it.
  5. Verify — confirm that the site works on both the front end and the admin dashboard, then gradually re-enable what you disabled.
Diagnosing common WordPress errorsWhite screen / 500 errorBackup + WP_DEBUGand read the error logConflicting pluginDisable all, re-enable graduallyThemeSwitch to a default themeMemory limitRaise WP_MEMORY_LIMITCorrupted .htaccessRegenerate itIsolate the cause by elimination — change one factor at a time
Diagnosing WordPress errors: from a white screen or 500 error > a backup, enabling WP_DEBUG and reading the log > isolating the cause (plugin/theme/memory limit/.htaccess) > the right fix.

This order isn't a suggestion; it is a safety guarantee. The backup first protects you from making the damage worse, and diagnosing before isolating saves you hours of blind trial and error. The following table links the most common symptoms to their likely causes and first fixes — use it as a quick starting point:

Visible symptomMost likely causeSuggested first fix
A completely blank white screen (WSOD)A fatal PHP error or out of memoryEnable WP_DEBUG, raise memory, disable plugins
"There has been a critical error on this website"A plugin/theme throwing a fatal errorOpen the recovery mode email, disable the suspect plugin
500 Internal Server ErrorCorrupted .htaccess or a memory/execution limitRegenerate .htaccess, check the server log
«Error establishing a database connection»Wrong DB credentials or corrupted tablesCorrect wp-config.php, repair the tables
502/504 on loadPHP timeout or server overloadRaise max_execution_time, contact your provider
An error after updating/installing a pluginA conflict or broken codeDisable the plugin via FTP, roll back to the previous version
«Briefly unavailable for scheduled maintenance»A stuck .maintenance fileDelete the .maintenance file from the root

When should you take the backup? If your site can still reach the admin dashboard, use a backup plugin such as UpdraftPlus right away. If the dashboard has collapsed, copy the entire site folder via FTP and export the database from phpMyAdmin before touching anything. See the website backup guide for a systematic plan.

How do you enable WP_DEBUG and read the error log?

WP_DEBUG is the most important diagnostic tool in your arsenal, and ignoring it is the number one cause of wasted time. By default, WordPress hides PHP errors from visitors (for security reasons), so you see a white screen with no explanation. Enabling debug mode turns that silent screen into a message that tells you the exact file and line that caused the failure.

Enabling debugging and logging to a file

Open the wp-config.php file in the site root via FTP or the cPanel File Manager, and look for the line /* That's all, stop editing! */. Directly before this line, add the following:

php
// Enable debug mode
define( 'WP_DEBUG', true );

// Log errors to debug.log instead of showing them to visitors
define( 'WP_DEBUG_LOG', true );

// Don't display errors on screen to visitors (security + a clean site)
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

With this setup, visitors won't see anything, but every error will be logged to the debug.log file inside the wp-content/ folder. Open the site or the broken page once, then open wp-content/debug.log via FTP and read the last lines — you will usually find a line like:

bash
PHP Fatal error: Uncaught Error: Call to undefined function ...
in /home/user/public_html/wp-content/plugins/some-plugin/file.php on line 142

This line gives you the plugin name, the file and the line number — a complete diagnosis in seconds. The following table explains the key debugging constants and what each one does:

ConstantFunctionRecommended value while diagnosing
WP_DEBUGTurns debug mode on/off entirelytrue
WP_DEBUG_LOGWrites errors to wp-content/debug.logtrue
WP_DEBUG_DISPLAYDisplays errors on the visitor's screenfalse
SCRIPT_DEBUGLoads the unminified core JS/CSS filestrue (when diagnosing the front end)
SAVEQUERIESLogs database queriestrue (only when diagnosing slowness)

Very important: set WP_DEBUG back to false as soon as you finish diagnosing. Leaving debugging enabled on a live site leaks server paths and may expose vulnerabilities. And delete the debug.log file after reading it, because it can grow large and contain sensitive information. For more on closing security gaps, see Securing a WordPress site.

Where can you find other error logs?

debug.log isn't the only source. Sometimes the error happens at the server level itself (PHP-FPM or Apache) before it reaches WordPress. The following table shows where the different logs are, depending on the type of hosting:

LogUsual locationReveals
WordPress debug logwp-content/debug.logPlugin, theme and core errors
PHP error logSet in php.ini or the hosting panelGeneral PHP errors before WordPress
Apache error log/var/log/apache2/error.log or error_log in cPanel500 errors, .htaccess problems
Nginx error log/var/log/nginx/error.log502/504 errors, upstream timeouts
cPanel logThe "Errors" / "Metrics" section in the panelA summary of the latest errors

On shared hosting you may not be able to reach the system logs directly, but cPanel usually provides an "Errors" section that shows the latest errors. On a VPS you can reach everything over SSH, as described in SSH basics for beginners.

How do you fix the white screen of death (WSOD)?

The white screen of death is a completely blank page with no text or error at all. It happens when a PHP script stops executing abruptly — either because of a fatal error in a plugin's or theme's code, or because PHP ran out of its allocated memory. Because it shows no message, your first step is always to enable WP_DEBUG_LOG as explained above, to turn the silence into a diagnosis.

An important note: in modern WordPress (5.2 and later), the white screen has become rarer, because WordPress catches fatal errors and shows the "There has been a critical error" message with recovery mode instead (we explain it in the next section). So if you see a completely white screen, the failure is most likely deeper: running out of memory, an error in the core itself, or a broken wp-config.php file.

Steps to fix the WSOD by elimination

Follow this order, and test the site after each step before moving on to the next:

  1. Raise the memory limit — add define( 'WP_MEMORY_LIMIT', '256M' ); to wp-config.php. Many WSOD cases are simply out-of-memory errors.
  2. Disable all plugins — rename the wp-content/plugins folder via FTP (explained below). If the site comes back, a plugin is the cause.
  3. Switch to a default theme — rename the current theme's folder so WordPress falls back to a default theme such as twentytwentyfour.
  4. Check wp-config.php — a stray space or syntax error after the closing tag ?> causes a white screen.
  5. Read debug.log — if the steps above don't work, the log reveals the exact file and line.

The following table links precise WSOD symptoms to their most likely causes to shorten your diagnosis:

When the white screen appearsMost likely causeFix
On the entire site (front end + dashboard)An error in the core or wp-config, or running out of memory entirelyRaise memory, check wp-config, read the log
On the front end only; the dashboard worksA theme errorSwitch to a default theme
On the admin dashboard onlyA plugin that runs in the dashboardDisable plugins via FTP
On one page onlyThat page's content/shortcodeDisable the plugin responsible for the shortcode
Right after installing/updating a pluginThe new pluginDelete/disable that plugin

What is the "critical error" and recovery mode?

Since version 5.2, WordPress has included fatal error protection. Instead of a white screen, if a plugin or theme throws a fatal error, WordPress shows a polite message: "There has been a critical error on this website. Please check your site admin email inbox for instructions." This message is the key to the fix, because it triggers an automatic email to the admin address.

The email you receive from WordPress contains three valuable things:

  1. The name of the plugin or theme responsible, the error message and the line number — a ready-made diagnosis without even opening FTP.
  2. A recovery mode link — it opens the admin dashboard in a safe mode that temporarily disables the broken component until you fix it.
  3. Additional technical details that help you understand the error.

Open the recovery link from the email, and you enter the admin dashboard with the broken plugin automatically paused and a red notice. You can then delete, update or replace it — then exit recovery mode and the site returns to normal. This mechanism means that in modern WordPress you rarely lose access completely.

What if the email doesn't arrive?

A common problem is that many sites don't send email successfully (a server without properly configured SMTP). If you didn't receive the recovery email, you have two options:

SituationAlternative fix
You know the admin email but nothing arrivesSet up email sending via an SMTP plugin, or use FTP directly
You can't access any emailDisable plugins manually via FTP/SSH (next section)
You want to force entry into recovery modeAdding ?action=enter_recovery_mode to the URL manually isn't enough on its own; disabling plugins via FTP is better
The error is in the theme, not a pluginSwitch to a default theme via FTP or phpMyAdmin

So the process doesn't depend on email at all — manually disabling via FTP solves everything, which is what we explain now.

How do you isolate the cause by disabling plugins and the theme manually?

Isolating the cause by elimination is the heart of diagnosis. If you have lost the admin dashboard, you can't disable anything from inside it — but WordPress is built cleverly: renaming a plugin or theme folder disables it automatically, because WordPress can't find it in its expected path. This trick rescues you in most failures.

Disabling all plugins at once (FTP/SSH)

The fastest way to find out whether a plugin is the cause: disable them all at once. Via FTP, go to wp-content/ and rename the plugins folder to plugins-off. Via SSH on a VPS, run:

bash
cd /home/user/public_html/wp-content
mv plugins plugins-off

Now open the site: if it works again, one of the plugins is the cause. Rename the folder back (mv plugins-off plugins), then disable the plugins one at a time by renaming each plugin's folder individually until the failure returns — that one is the culprit:

bash
cd /home/user/public_html/wp-content/plugins
mv suspect-plugin suspect-plugin-disabled

Switching to a default theme

If the failure persists after disabling all plugins, the theme is the next suspect. Rename your active theme's folder inside wp-content/themes/:

bash
cd /home/user/public_html/wp-content/themes
mv my-theme my-theme-disabled

When the active theme is missing, WordPress automatically falls back to the newest installed default theme (such as twentytwentyfour). Make sure at least one default theme exists in the folder. If the site comes back, the failure is in your theme — review the last change you made to it, or update it.

Disabling via phpMyAdmin (if FTP isn't available)

An alternative way to disable all plugins directly through the database: open phpMyAdmin, select the wp_options table, find the active_plugins row, and change its value to an empty array (a:0:{}). This disables all plugins immediately. The following table summarizes the isolation methods by the access tool you have:

Access methodTo disable pluginsTo disable the theme
Admin dashboard (if it works)Plugins > DeactivateAppearance > Themes > activate another theme
FTP / File ManagerRename pluginsRename the theme folder
SSHmv plugins plugins-offmv theme theme-off
phpMyAdminClear active_plugins in wp_optionsEdit template and stylesheet in wp_options

How do you fix the 500 Internal Server Error?

The "500 Internal Server Error" is a generic server message meaning "something went wrong, but I can't say what." In WordPress, its three most common causes are: a corrupted .htaccess file, exceeding the PHP memory limit, or a plugin/theme throwing an error at the server level. Unlike the white screen, a 500 error can appear even before WordPress loads, so debug.log may not catch it — check the server error log (Apache/Nginx) as well.

Understanding 5xx server error codes

Before fixing, distinguish between the error codes, because each points to a different source:

CodeMeaningCommon cause in WordPress
500A general internal server errorCorrupted .htaccess, fatal PHP error, out of memory
502Bad GatewayPHP-FPM is down or returning a malformed response
503Service temporarily unavailableThe server is fully loaded, or maintenance mode is stuck
504Gateway TimeoutA PHP process exceeded max_execution_time

502/504 codes are usually server or performance problems (PHP-FPM, execution timeouts), while 500 tends to point to problems in the application itself. If you keep running into 504 errors, the site may need more resources — see When to move to a VPS.

Regenerating the default .htaccess file

The number one cause of a 500 error is a corrupted .htaccess file (a plugin update or a wrong manual edit can break it). The fix: rename the current .htaccess to .htaccess-old via FTP, then try the site. If it works again, the file was the cause. Create a new .htaccess file in the root with the default WordPress content:

apache
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Then go to the admin dashboard (if it is back) and open "Settings > Permalinks" and save without changing anything — this regenerates the rules automatically. Note that the file name starts with a dot (.htaccess), so it may be hidden in the file manager; enable "Show hidden files."

Raising the memory limit and checking plugins

If .htaccess isn't the cause, raise the memory (next section), then disable plugins by elimination as explained. The following table is a 500-error diagnostic checklist, in order:

StepHowIf it works, it means
1. Rename .htaccess.htaccess → .htaccess-oldThe file was corrupted — regenerate it
2. Raise WP_MEMORY_LIMITEdit wp-config.phpIt was out of memory
3. Disable all pluginsRename pluginsA plugin is the cause — isolate it individually
4. Switch to a default themeRename the theme folderThe theme is the cause
5. Upload a clean copy of the coreReplace wp-admin and wp-includesCorrupted core files

How do you get past the PHP memory limit?

Many WordPress errors — the white screen, failed image uploads, the admin dashboard breaking on a particular page — are really caused by PHP running out of memory. The classic message in the log: Allowed memory size of 134217728 bytes exhausted. The fix is to raise the limit allocated to WordPress.

Raising WP_MEMORY_LIMIT in wp-config.php

Add these two lines to wp-config.php before /* That's all, stop editing! */:

php
// Memory limit for the front end
define( 'WP_MEMORY_LIMIT', '256M' );

// A higher limit for the admin dashboard (heavier operations)
define( 'WP_MAX_MEMORY_LIMIT', '512M' );

If this doesn't actually raise the limit (some hosts cap it at the php.ini level), add the following in php.ini or through the hosting panel: memory_limit = 256M. In some environments you can put a directive in .htaccess: php_value memory_limit 256M. The following table recommends memory limits by type of site:

Site typeRecommended memory limitNote
Simple blog / brochure site128M – 256MEnough for most lightweight themes
A site with a moderate number of plugins256MThe most common and balanced setting
WooCommerce store256M – 512MOperations and reports consume more
Large site / big publisher512M or moreAsk your provider to raise it in php.ini

Raise memory only as much as you need — raising it unnecessarily on shared hosting may violate the provider's limits. If you reach 512M and still run out, the problem is usually a badly written plugin (a memory leak), not the limit itself.

Raising upload limits

A related problem: uploading a large image, theme or plugin fails with a message saying the file exceeds the maximum size. These upload limits are separate from memory. Adjust them in php.ini:

apache
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
max_input_time = 300
memory_limit = 256M

On shared hosting you may need to ask support to raise them. On a VPS you adjust them yourself and then restart PHP-FPM. The same limits affect site migrations — see Migrating WordPress without downtime before any move.

How do you fix the database connection error?

"Error establishing a database connection" is one of the most alarming errors because it takes the whole site down, but its causes are specific and fixable. WordPress stores all content (posts, settings, users) in a MySQL database, and this error means it couldn't connect to it. The four main causes: wrong credentials in wp-config.php, a stopped database server, corrupted tables, or excessive load on the server.

Correcting the connection details in wp-config.php

The first thing to check: four constants in wp-config.php must match exactly what is in your hosting panel:

php
define( 'DB_NAME', 'database_name' );         // database name
define( 'DB_USER', 'username' );              // database user
define( 'DB_PASSWORD', 'password' );          // the user's password
define( 'DB_HOST', 'localhost' );             // usually localhost

The most common mistakes: changing the database password in the hosting panel without updating it in wp-config.php, or an error in DB_HOST (some providers use a dedicated address rather than localhost). Check the correct values in the "MySQL Databases" section of cPanel. The following table links database error symptoms to their causes:

SymptomLikely causeFix
The error appears on both the front end and the dashboardWrong connection details or the DB server is downCorrect wp-config, check MySQL's status
The dashboard says "The database may need to be repaired"Corrupted tablesEnable the automatic repair (below)
The error is intermittent (it comes and goes)Load/resource exhaustion on the serverContact your provider; consider upgrading resources
It appeared after changing the DB passwordA DB_PASSWORD mismatchUpdate the constant to match the new one

Repairing corrupted database tables

If the credentials are correct but the tables are corrupted, WordPress provides a built-in automatic repair. Add this line temporarily to wp-config.php:

php
define( 'WP_ALLOW_REPAIR', true );

Then open this URL in your browser: https://yoursite.com/wp-admin/maint/repair.php and choose "Repair Database" (or "Repair and Optimize"). Once the repair is done, remove the line immediately, because this page doesn't require login and anyone can access it. Alternatively, you can repair from phpMyAdmin: select the tables, then choose "Repair table" from the drop-down menu.

How do you reach your site when you lose the admin dashboard?

The hardest moment is when the site crashes and you lose access to wp-admin itself, so you can't disable anything from the inside. This is where three back-end access tools that don't depend on the WordPress dashboard at all come to the rescue:

ToolWhat it gives you access toMain use during failures
FTP / SFTP / cPanel File ManagerThe site's filesDisabling plugins/the theme, editing wp-config/.htaccess, reading debug.log
SSH (on a VPS)Files + the command lineAll of the above + WP-CLI + system logs
phpMyAdminThe databaseRepairing tables, disabling plugins, changing the admin password

Resetting the admin password via phpMyAdmin

If you forgot the admin password and the reset email didn't arrive, you can set it directly in the database: open phpMyAdmin, select the wp_users table, edit the user's row, and in the user_pass field choose the MD5 function from the drop-down list, then type the new password. WordPress accepts MD5 and rehashes the password securely on the first login.

Using WP-CLI on a VPS

If your site is on a VPS, WP-CLI is the fastest way to handle failures from the command line without the dashboard. Practical examples:

bash
# Deactivate all plugins at once
wp plugin deactivate --all

# Activate a default theme
wp theme activate twentytwentyfour

# Flush the cache (if a caching plugin is the cause)
wp cache flush

# Verify core file integrity against the official release
wp core verify-checksums

The verify-checksums command in particular is powerful: it compares your core files with the official release and reveals any modified or injected file — very useful when you suspect a breach. If it finds modified files, your site may be infected; see Detecting and removing website malware for the steps.

How do you deal with errors after an update or installing a plugin?

The largest share of WordPress failures happen right after an update (core, plugin or theme) or after installing a new plugin. The cause is usually a version conflict, a plugin that hasn't been tested with your current WordPress version, or an update that broke off midway. The good news is that the culprit is usually known: the last thing you changed.

The "last change is the suspect" rule

If the site crashed after installing a particular plugin, disable it via FTP (rename its folder) and the site will come back immediately. If it crashed after updating a plugin, roll back to its previous version (the WP Rollback plugin if the dashboard works, or upload the old version manually via FTP). The following table is a checklist for before any update, to avoid disaster in the first place:

Before updating, do thisWhy
Take a full backup (files + DB)The first safety net for an instant rollback
Update in a staging environment firstYou catch conflicts before they touch the live site
Update one component at a timeYou know exactly what caused the failure
Check the plugin's compatibility with your WordPress versionAbandoned plugins are a major source of conflicts
Record a list of your current versionsMakes it easy to roll back to the working version

The stuck maintenance file

A common error after an interrupted update: the message "Briefly unavailable for scheduled maintenance." It happens when WordPress places a .maintenance file in the root during the update and then fails before deleting it. The fix is very simple: delete the .maintenance file from the site root via FTP, and the site comes back immediately. Note that the file is hidden (it starts with a dot), so you need to enable showing hidden files.

How do you protect your site from errors before they happen?

The best plan for fixing errors is for them not to happen in the first place. Prevention doesn't eliminate failures completely, but it makes them rare and reversible in seconds instead of hours. Three pillars protect your site from most disasters:

The first pillar: regular backups

A backup is the difference between an annoying failure and a complete disaster. With a recent backup, the worst-case scenario is a restore that takes minutes. Make backups automatic and off-site, so you don't depend on a copy stored on the same server that might crash.

Three layers of safe backupsSnapshotOff-siteApplicationInfra snapshotFull off-site backupApp-level backupFast recoveryOf the whole serverSurvives failureof the server itselfFiles + databaseSeparate data
Three layers of protection: a fast snapshot, a full off-server (off-site) backup, and an application/database-level backup.

Set a schedule based on how active your site is: a blog updated weekly is fine with a weekly backup, while a store with daily orders needs daily backups or more. See the website backup guide for a complete plan.

The second pillar: a staging environment

A staging environment is an exact copy of your site where you test updates and changes before applying them to the live site. If an update breaks something, it breaks only the staging copy while your real site stays intact. Most managed hosting providers offer one-click staging. The rule: never update directly on production.

The third pillar: orderly updates and a minimum of plugins

Every plugin is a potential attack surface and a source of conflicts. Install only what you actually need, delete what is disabled, and update regularly but carefully (one at a time, after a backup). The following table summarizes the prevention habits:

HabitRecommended frequencyImpact
Full backupDaily (store) / weekly (blog)Fast recovery from any failure
Updating on staging firstWith every updateKeeps conflicts from reaching production
Updating the core and pluginsWhen security updates are releasedCloses vulnerabilities before they are exploited
Deleting unused plugins/themesMonthlyReduces conflicts and the attack surface
Reviewing debug.log periodicallyMonthlyReveals warnings before they become failures

Security is an integral part of stability — a compromised site breaks in mysterious ways. Strengthen your defenses in layers, as in the following diagram:

WordPress security layers (defense in depth)Automatic backupsRegular updates (core/plugins/themes)Firewall / WAFStrong login + two-factor authSSL / HTTPSWordPress coreEvery layer reduces risk — don't rely on just one
Multi-layered defense for WordPress: backups, updates, a WAF, strong login + 2FA, and SSL/HTTPS around the core.

For the full depth, see Securing a WordPress site, and for performance work that reduces timeout and 504 errors, see Speeding up a WordPress site.

When should you contact technical support?

Not every error is your responsibility. Some happen at the server level, outside your control, and then your host's technical support is the fastest fix. Contact support when you see:

  • A database error that persists after correcting wp-config.php (the MySQL server may be down on their side).
  • Repeated 502/503/504 errors that don't go away when you disable plugins (a resource or server configuration problem).
  • A need to raise php.ini limits (memory, uploads, execution time) on shared hosting.
  • A suspected breach or injected files you can't clean up yourself.
  • Repeated slowness or outages that point to a need for more resources.

Before you get in touch, prepare the information to speed up the fix: the exact error text, the last change you made, the steps you tried, and an excerpt from debug.log. Good support solves in minutes what could take you hours.

Frequently asked questions

Why does my site show a completely blank white screen?

The white screen of death (WSOD) means a PHP script stopped abruptly without displaying a message, usually because of a fatal error in a plugin or theme, or because PHP ran out of memory. The fix: enable WP_DEBUG_LOG in wp-config.php and read the wp-content/debug.log file to find the file and line responsible, then raise the memory limit and disable plugins by elimination.

How do I enable WP_DEBUG if I can't reach the admin dashboard?

Through FTP or the cPanel File Manager. Download the wp-config.php file from the site root, add define( 'WP_DEBUG', true ); and define( 'WP_DEBUG_LOG', true ); before the line /* That's all, stop editing! */, then upload the file. Open the broken page once, then read wp-content/debug.log. You don't need the admin dashboard at all.

What is the difference between the white screen and "There has been a critical error"?

Both result from a fatal error, but "There has been a critical error" is the modern behavior (since WordPress 5.2): WordPress catches the error, shows a polite message and sends an email with a recovery mode link. The white screen is the older behavior, or it appears when the error occurs in the core itself or when memory runs out completely before the catching mechanism can run.

How do I disable all plugins when I can't reach the dashboard?

Via FTP, go to wp-content/ and rename the plugins folder to plugins-off. This disables all plugins immediately. If the site comes back, rename the folder to its original name, then disable the plugins one by one to identify the culprit. Alternatively, you can clear the active_plugins value in the wp_options table through phpMyAdmin.

How do I fix "Error establishing a database connection"?

First check that DB_NAME, DB_USER, DB_PASSWORD and DB_HOST in wp-config.php match the values in your hosting panel (the MySQL Databases section). The most common cause is changing the database password without updating the file. If the credentials are correct, the tables may be corrupted: add define( 'WP_ALLOW_REPAIR', true ); and open /wp-admin/maint/repair.php, then remove the line after the repair.

What should the PHP memory limit be for WordPress?

256M is a balanced value for most sites. Simple blogs are fine with 128M–256M, and WooCommerce stores need 256M–512M. Add define( 'WP_MEMORY_LIMIT', '256M' ); to wp-config.php. If you reach 512M and still run out of memory, the problem is usually a badly written plugin, not the limit.

What causes a 500 error, and how do I fix it quickly?

The most common cause of a 500 error is a corrupted .htaccess file. Rename it to .htaccess-old via FTP and try the site; if it comes back, create a new .htaccess with the default WordPress content and save "Permalinks" in the dashboard. If that doesn't work, raise the memory limit, disable plugins by elimination, and check the server error log, because a 500 error may not show up in debug.log.

What should I do if I receive a "There has been a critical error" email?

Open the email: it contains the name of the plugin or theme responsible, the error message and a Recovery Mode link. Click the link to enter the admin dashboard in safe mode with the broken component automatically disabled, then delete, update or replace it, and exit recovery mode. If you didn't receive an email, disable plugins manually via FTP.

Is enabling WP_DEBUG dangerous on my live site?

It isn't dangerous if you configure it correctly: use WP_DEBUG_LOG with WP_DEBUG_DISPLAY set to false so errors are logged to a file instead of being shown to visitors. But don't leave it enabled after you finish diagnosing, because displaying errors leaks server paths and may reveal information useful to an attacker. Set it back to false and delete debug.log after reading it.

How do I prevent WordPress errors from recurring?

Three habits prevent most failures: regular automatic off-server backups, testing every update in a staging environment before production, and orderly updates of the core and plugins (one at a time, after a backup) while removing anything unused. These habits turn failures from disasters into restores that take minutes.

Can I lose my data while fixing these errors?

Very rarely. Most WordPress errors (the white screen, 500, the critical error) are problems in code or settings, not in data, and fixing them doesn't touch your content. The only real risk to your data is a wrong change to the database or deleting files without understanding them — which is why every operation starts with a backup. With a recent backup, your data is always safe.

Conclusion

WordPress errors look frightening, but they can be solved with an organized method: a backup, then enabling WP_DEBUG and reading the log, then isolating the cause by elimination, then fixing and verifying. Don't guess — the log points you to the exact file and line, and back-end access tools (FTP/SSH/phpMyAdmin) keep every fix within reach even if you lose the admin dashboard. And most importantly: prevention through backups, a staging environment and orderly updates turns most potential disasters into restores that take minutes.

When choosing your hosting, look for features that make fixing these errors much simpler: an easy staging environment, regular backups, flexible resource limits, and technical support that can handle server problems.

Sources

Frequently asked questions

Why does my site show a completely blank white screen?

The white screen of death (WSOD) means a PHP script stopped abruptly without displaying a message, usually because of a fatal error in a plugin or theme, or because PHP ran out of memory. The fix: enable WP_DEBUG_LOG in wp-config.php and read the wp-content/debug.log file to find the file and line responsible, then raise the memory limit and disable plugins by elimination.

How do I enable WP_DEBUG if I can't reach the admin dashboard?

Through FTP or the cPanel File Manager. Download the wp-config.php file from the site root, add define( 'WP_DEBUG', true ); and define( 'WP_DEBUG_LOG', true ); before the line / That's all, stop editing! /, then upload the file. Open the broken page once, then read wp-content/debug.log. You don't need the admin dashboard at all.

What is the difference between the white screen and "There has been a critical error"?

Both result from a fatal error, but "There has been a critical error" is the modern behavior (since WordPress 5.2): WordPress catches the error, shows a polite message and sends an email with a recovery mode link. The white screen is the older behavior, or it appears when the error occurs in the core itself or when memory runs out completely before the catching mechanism can run.

How do I disable all plugins when I can't reach the dashboard?

Via FTP, go to wp-content/ and rename the plugins folder to plugins-off. This disables all plugins immediately. If the site comes back, rename the folder to its original name, then disable the plugins one by one to identify the culprit. Alternatively, you can clear the active_plugins value in the wp_options table through phpMyAdmin.

How do I fix "Error establishing a database connection"?

First check that DB_NAME, DB_USER, DB_PASSWORD and DB_HOST in wp-config.php match the values in your hosting panel (the MySQL Databases section). The most common cause is changing the database password without updating the file. If the credentials are correct, the tables may be corrupted: add define( 'WP_ALLOW_REPAIR', true ); and open /wp-admin/maint/repair.php, then remove the line after the repair.

What should the PHP memory limit be for WordPress?

256M is a balanced value for most sites. Simple blogs are fine with 128M–256M, and WooCommerce stores need 256M–512M. Add define( 'WP_MEMORY_LIMIT', '256M' ); to wp-config.php. If you reach 512M and still run out of memory, the problem is usually a badly written plugin, not the limit.

What causes a 500 error, and how do I fix it quickly?

The most common cause of a 500 error is a corrupted .htaccess file. Rename it to .htaccess-old via FTP and try the site; if it comes back, create a new .htaccess with the default WordPress content and save "Permalinks" in the dashboard. If that doesn't work, raise the memory limit, disable plugins by elimination, and check the server error log, because a 500 error may not show up in debug.log.

What should I do if I receive a "There has been a critical error" email?

Open the email: it contains the name of the plugin or theme responsible, the error message and a Recovery Mode link. Click the link to enter the admin dashboard in safe mode with the broken component automatically disabled, then delete, update or replace it, and exit recovery mode. If you didn't receive an email, disable plugins manually via FTP.

Is enabling WP_DEBUG dangerous on my live site?

It isn't dangerous if you configure it correctly: use WP_DEBUG_LOG with WP_DEBUG_DISPLAY set to false so errors are logged to a file instead of being shown to visitors. But don't leave it enabled after you finish diagnosing, because displaying errors leaks server paths and may reveal information useful to an attacker. Set it back to false and delete debug.log after reading it.

How do I prevent WordPress errors from recurring?

Three habits prevent most failures: regular automatic off-server backups, testing every update in a staging environment before production, and orderly updates of the core and plugins (one at a time, after a backup) while removing anything unused. These habits turn failures from disasters into restores that take minutes.

Can I lose my data while fixing these errors?

Very rarely. Most WordPress errors (the white screen, 500, the critical error) are problems in code or settings, not in data, and fixing them doesn't touch your content. The only real risk to your data is a wrong change to the database or deleting files without understanding them — which is why every operation starts with a backup. With a recent backup, your data is always safe.