Fixing Common WordPress Errors
Staying Calm When Something Breaks
Most WordPress errors are common, well-documented, and fixable once you know where to look, even though they can look alarming at first.
Common Errors and Fixes
The White Screen of Death usually points to a plugin or theme conflict; deactivate plugins via FTP one by one to isolate it.
A 500 Internal Server Error often relates to a corrupted .htaccess file or exhausted memory limit, both fixable by regenerating the file or raising the PHP memory limit.
An "Error Establishing a Database Connection" message usually means incorrect database credentials in wp-config.php or a database server issue.
General Troubleshooting Steps
Enable WP_DEBUG in wp-config.php temporarily to reveal the specific error behind a generic message.
Always restore from a backup first if a fix doesn't work, rather than making further risky changes on a live site.
| Error | Common Cause | First Fix to Try |
|---|---|---|
| White Screen of Death | Plugin/theme conflict | Deactivate plugins via FTP |
| 500 Internal Server Error | Corrupted .htaccess or memory limit | Regenerate .htaccess / raise memory limit |
| Database Connection Error | Wrong DB credentials | Check wp-config.php details |
Many of these errors can be avoided altogether by staying on top of updates and knowing how to debug safely.
More Errors You Are Likely to Meet
| Error or symptom | Usual cause | Safe fix |
|---|---|---|
| "There has been a critical error on this website" | A PHP fatal error, often from a plugin update | Use the recovery-mode link emailed to the admin, or check the debug log |
| "Briefly unavailable for scheduled maintenance" | An update was interrupted | Delete the .maintenance file in the site root, then rerun the update |
| Posts return 404 but the homepage works | Rewrite rules are out of date | Open Settings, then Permalinks, and click Save |
| "Allowed memory size exhausted" | PHP memory limit too low for a plugin | Raise WP_MEMORY_LIMIT or ask the host to raise PHP memory |
| Too many redirects | Mismatched site URL, HTTP/HTTPS or proxy settings | Check WordPress Address and Site Address, clear cookies |
| Image upload fails | Folder permissions or size limits | Check wp-content/uploads permissions and PHP upload limits |
Turning On Debugging Without Exposing Errors
Showing PHP errors to visitors can leak file paths and other details. A safer setup writes errors to a log file only. Add these lines to wp-config.php above the "That's all, stop editing" comment:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true ); // writes to wp-content/debug.log
define( 'WP_DEBUG_DISPLAY', false ); // hide errors from visitors
@ini_set( 'display_errors', 0 );
define( 'WP_MEMORY_LIMIT', '256M' ); // only if memory errors appear
Reproduce the problem, read the last lines of debug.log, and look for a plugin or theme folder name in the file path. Once fixed, set WP_DEBUG back to false and delete the log, since it can contain sensitive details.
Faster Fixes with WP-CLI
If your host provides SSH access, WP-CLI solves many problems without touching FTP:
wp plugin deactivate --all # rule out plugin conflicts
wp plugin activate woocommerce # re-enable one at a time
wp theme list # find a default theme to switch to
wp core verify-checksums # detect modified core files
wp rewrite flush # rebuild permalinks
wp option get siteurl # check the stored site URL
If .htaccess is corrupted on an Apache server, replacing it with the standard WordPress block usually brings the site back:
# 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
A Calm Troubleshooting Routine
- Note what changed last: an update, a new plugin, a hosting change or an edit to a theme file.
- Take a backup of files and database before making any fix.
- Isolate: disable plugins, then switch to a default theme, testing after each step.
- Read the logs: the WordPress debug log and the server error log from your hosting panel.
- Fix one thing at a time and retest, so you know exactly which change solved it.
- Prevent a repeat: test updates on a staging copy, keep plugins few and maintained, and schedule automatic backups.
If wp core verify-checksums reports changed core files you did not edit, treat it as a possible compromise: restore clean files, update everything, change passwords and review admin users.
Ready to master WordPress Training Course?
Join Uncodemy's hands-on, mentor-led WordPress training and build real, live websites.