Every developer, webmaster, and student who works with WordPress will inevitably encounter server crashes, fatal PHP exceptions, and database connection timeouts. When an error strikes, beginners often panic and consider reinstalling WordPress from scratch. However, WordPress errors are completely deterministic: they leave diagnostic log footprints that point directly to the broken line of code. This master troubleshooting manual provides instant, field-tested solutions to the 25 most common WordPress errors.
When WordPress encounters a fatal PHP error, it suppresses detailed error messages by default for security, displaying only a generic message: "There has been a critical error on this website." To unmask the exact broken file and line number, open wp-config.php and replace define('WP_DEBUG', false); with these three diagnostic lines:
// Enable WordPress Debug Logging to /wp-content/debug.log
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false); // Keep hidden from public visitors!
@ini_set('display_errors', 0);
Now, whenever an error occurs, WordPress logs the exact stack trace to /wp-content/debug.log without exposing system paths to public visitors!
| Error Name & Symptom | Root Cause | Instant Step-by-Step Resolution |
|---|---|---|
| 1. White Screen of Death (WSOD) Completely blank white screen on front and back end. |
PHP Fatal Error caused by a plugin conflict or memory limit exhaustion. | 1) Check /wp-content/debug.log; 2) Rename /wp-content/plugins/ to plugins-old via FTP to restore access; 3) Increase PHP memory limit. |
| 2. Error Establishing a Database Connection Site displays this text and refuses to load. |
Incorrect MySQL credentials in wp-config.php or MySQL server service crashed. |
1) Verify MySQL is running in XAMPP/server; 2) Check DB_NAME, DB_USER, DB_PASSWORD, DB_HOST in wp-config.php; 3) Repair database by adding define('WP_ALLOW_REPAIR', true); and visiting /wp-admin/maint/repair.php. |
| 3. 500 Internal Server Error Generic server error message on page hit. |
Corrupted .htaccess file, bad PHP syntax in active theme, or memory exhaustion. |
1) Rename .htaccess to .htaccess-old and refresh; 2) Regenerate permalinks in Settings > Permalinks; 3) Increase memory_limit = 256M. |
| 4. Posts Returning 404 Not Found Homepage loads, but all individual posts return 404. |
Missing or corrupted rewrite rules in Apache .htaccess. |
Go to Settings > Permalinks in wp-admin and simply click "Save Changes" without altering any options to force WordPress to regenerate rules. |
| 5. Stuck in Maintenance Mode "Briefly unavailable for scheduled maintenance." |
An update timed out or crashed before deleting the temporary lock file. | Log in via FTP or File Manager, navigate to root directory, and DELETE the hidden .maintenance file. |
| 6. Memory Exhausted Error "Fatal error: Allowed memory size of X bytes exhausted..." |
A plugin or query exceeded PHP's allocated memory allocation. | Add this line to wp-config.php: define('WP_MEMORY_LIMIT', '256M');. Alternatively, update memory_limit = 256M in php.ini. |
| 7. Mixed Content Warning (Broken SSL) Padlock icon missing; browser warns site is not secure. |
Hardcoded HTTP (http://) image or script URLs loading on an HTTPS page. |
Install the Better Search Replace plugin and search-replace http://example.com with https://example.com across all database tables. |
| 8. Maximum Execution Time Exceeded "Fatal error: Maximum execution time of 30 seconds exceeded..." |
A heavy operation (import, backup, large plugin update) ran longer than PHP allowed. | Add max_execution_time = 300 in your php.ini or add set_time_limit(300); in wp-config.php. |
| 9. WordPress Not Sending Emails Form submissions and password resets never arrive. |
Unauthenticated PHP mail() blocked by server or flagged as spam by Gmail. |
Install FluentSMTP or WP Mail SMTP and route outbound mail through authenticated SMTP (SendGrid, Amazon SES, Google Workspace). |
| 10. Uploaded File Exceeds upload_max_filesize Media uploader rejects file. |
PHP server upload limits set too low (default 2 MB). | Update your php.ini with: upload_max_filesize = 64M and post_max_size = 64M. |
If a security plugin locks you out or you forget your administrator password: Open phpMyAdmin, navigate to the wp_users table, edit your user record, change user_pass to your new password, and select the MD5 hashing function from the dropdown. Save the row! When you log in, WordPress will detect the MD5 hash and automatically re-hash it into modern salted phpass.
Expand your CMS mastery by studying these tightly integrated WordPress development topics:
Differentiate between legitimate server errors and malware infections.
Fix 'Error Establishing a Database Connection' and corrupted DB tables.
Avoid update-induced White Screen of Death (WSOD) using debug flags.
WP_DEBUG, WP_DEBUG_LOG, and error logging configuration snippets.