WordPress Troubleshooting

The Definitive Guide to WordPress Errors — Diagnosed and Fixed

Every common WordPress error, what causes it, and exactly how to fix it. White screen, 500, database errors, login loops, and more — all covered.

Quick Answer: Most WordPress errors fall into four categories — PHP fatal errors (white screen, 500), database errors (connection failures, table corruption), update failures (broken plugins/themes), and configuration errors (redirect loops, login issues). Enable WP_DEBUG to surface the exact error message, then use this guide to fix it.

Before You Start — Enable Debug Mode

Before diagnosing any WordPress error, enable debug logging so you can see the actual error message rather than a generic failure screen. Add these three lines to wp-config.php above the line that says "That's all, stop editing!":

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

This writes errors to wp-content/debug.log without displaying them to site visitors. Check this file after reproducing the error — the specific PHP error or function name it references will tell you exactly which plugin, theme, or core file is the source.

Remember to remove or disable these lines once you've resolved the issue.

White Screen of Death (WSOD)

A completely blank white page — no error message, no content — is almost always a PHP fatal error that exhausted memory or hit a fatal exception before WordPress could render anything.

Most common causes: a plugin or theme with a PHP fatal error, WordPress memory limit too low, or a corrupted plugin file from a failed update.

Fix it:

  1. Enable WP_DEBUG as above and check debug.log for the specific error
  2. If the error names a plugin, deactivate it via FTP by renaming its folder in wp-content/plugins/
  3. If no specific plugin is named, deactivate all plugins by renaming the entire wp-content/plugins/ folder to plugins-disabled/
  4. If the site loads after deactivating plugins, reactivate one at a time to find the culprit
  5. If deactivating plugins doesn't help (see our full plugin conflict guide for detailed steps), switch to a default WordPress theme by renaming your theme folder in wp-content/themes/
  6. If the WSOD only appears on the admin side, try increasing memory: add define('WP_MEMORY_LIMIT', '256M'); to wp-config.php

500 Internal Server Error

A 500 error means the server encountered an unexpected condition. Unlike the WSOD, this error comes from the web server (Apache or Nginx) rather than PHP itself.

Most common causes: a corrupted .htaccess file, exhausted PHP memory, a PHP version incompatibility, or a plugin causing a server-level error.

Fix it:

  1. Reset your .htaccess file — rename it to .htaccess-old via FTP, then go to Settings → Permalinks in WordPress and click Save to regenerate a clean one
  2. Check your server's error log (not WordPress's debug log) — your host's control panel usually provides access to this
  3. Deactivate all plugins via FTP as described above
  4. Check if your PHP version is compatible with your plugins and theme
  5. Ask your host to check server-level error logs if the above doesn't surface the cause

Error Establishing a Database Connection

This error means WordPress cannot connect to its MySQL database. The site is completely inaccessible — both front-end and admin.

Most common causes: incorrect database credentials in wp-config.php, the database server is down or overloaded (common on shared hosting), or the database itself is corrupted.

Fix it:

  1. Verify your database credentials in wp-config.php — DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST must all be correct. These are set when WordPress is installed and can become mismatched after a hosting migration
  2. Log into your host's database management tool (phpMyAdmin or similar) using the same credentials to confirm they work
  3. If credentials are correct but you still can't connect, the database server may be down — contact your host
  4. If you can connect but WordPress still shows the error, the database may be corrupted. Visit yoursite.com/wp-admin/maint/repair.php — WordPress has a built-in repair tool that you can enable by adding define('WP_ALLOW_REPAIR', true); to wp-config.php

WordPress Login Redirect Loop

You enter your credentials, WordPress appears to log you in, then redirects back to the login page repeatedly without actually granting access.

Most common causes: a cookie issue, incorrect WordPress URL settings, or a caching plugin serving a cached version of the login page.

Fix it:

  1. Clear your browser cookies for your site's domain, then try logging in again
  2. Clear your site's cache completely if you have a caching plugin
  3. Check that siteurl and home in your database (wp_options table) match your actual site URL exactly — a mismatch after a migration is a common cause
  4. Add these lines to wp-config.php to force the correct URLs: define('WP_HOME','https://yoursite.com'); and define('WP_SITEURL','https://yoursite.com');

Fatal Error: Maximum Execution Time Exceeded

PHP has a time limit for script execution. When a plugin or process exceeds it, WordPress throws a fatal error. This is common during large imports, theme builds, or plugin operations that process a lot of data.

Fix it:

  1. Add set_time_limit(300); to wp-config.php to temporarily increase the limit to 5 minutes
  2. Ask your host to increase the PHP max_execution_time in your server configuration
  3. If the error is triggered by a specific plugin operation, check that plugin's settings for batch size — reducing the number of items processed per batch reduces execution time per run

Briefly Unavailable for Scheduled Maintenance

WordPress creates a .maintenance file in the root directory during updates. If an update fails or the file isn't removed, the site stays in maintenance mode indefinitely.

Fix it: Connect via FTP and delete the .maintenance file from your WordPress root directory. The site returns immediately.

404 on All Pages Except the Homepage

If your homepage loads but every other page throws a 404, your permalink structure is broken — usually caused by a corrupted .htaccess file or a server that doesn't support mod_rewrite.

Fix it:

  1. Go to Settings → Permalinks and click Save Changes without changing anything — this regenerates the .htaccess rewrite rules
  2. If that doesn't work, check that mod_rewrite is enabled on your server (ask your host)
  3. Verify your .htaccess file contains the standard WordPress rewrite block — if it's missing or corrupted, replace it with the default WordPress .htaccess content

Mixed Content Warnings (HTTP/HTTPS)

After migrating to HTTPS, some resources (images, scripts, stylesheets) may still be referenced with HTTP URLs, causing browser security warnings and breaking page display.

Fix it:

  1. Run a search-replace in your database using a plugin like Better Search Replace — replace http://yoursite.com with https://yoursite.com
  2. Update your WordPress URL settings in Settings → General to use HTTPS
  3. Add HTTPS enforcement to your .htaccess or ask your host/CDN to handle it at the server level

When to Stop Troubleshooting and Get Professional Help

If you've worked through the relevant steps and the error persists, or if the error is on a site handling payments, memberships, or other critical functionality where downtime has real business impact — stop experimenting and get help. Further troubleshooting without deep WordPress and server knowledge can compound the problem.

CriticalWP's emergency support covers all of the errors above — systematic diagnosis, root cause identification, and a proper fix. On a CriticalWP managed plan, most of these issues are prevented entirely through managed updates and proactive monitoring.

Frequently Asked Questions

Enable WP_DEBUG and check debug.log. Deactivate all plugins via FTP by renaming the plugins folder. If the site loads, reactivate one at a time to find the culprit.
Verify credentials in wp-config.php. If correct, the database server may be down — contact your host. Use WordPress repair tool at yoursite.com/wp-admin/maint/repair.php if still failing.
Rename .htaccess then go to Settings then Permalinks and Save to regenerate it. Check server error logs and deactivate all plugins via FTP to rule out conflicts.
Clear browser cookies. Verify siteurl and home in wp_options match your actual URL. Add define WP_HOME and define WP_SITEURL to wp-config.php if mismatched.
Connect via FTP and delete the .maintenance file from your WordPress root directory.

Prevent WordPress errors before they happen.

CriticalWP manages your updates, monitors your site, and handles issues before they take your site down — for $50/month.