Available for new projectsCairo · London · Serving the Gulf, Egypt and Europe

How to Fix the Most Common WordPress Errors: White Screen, 500, Database and More

How to Fix Common WordPress Errors

WordPress errors look scary, but most have simple causes: a conflicting plugin, a theme bug, a memory limit or a configuration mistake. With a calm, methodical approach and a recent backup, you can fix most of them yourself.

Key takeaways

  • Take a backup before troubleshooting.
  • Enable debug logging to see the real error.
  • Deactivate plugins and switch to a default theme to find conflicts.
  • Check hosting resources and PHP version.

Before you start

Back up files and the database, note what changed recently (updates, new plugins, code edits) and enable debugging in wp-config.php:

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

Errors will be written to wp-content/debug.log.

White screen of death

Usually a fatal PHP error from a plugin or theme. Rename the plugins folder via FTP or file manager to deactivate all plugins; if the site returns, reactivate them one by one. If not, switch to a default theme. Increasing the PHP memory limit can also help.

500 Internal Server Error

Check for a corrupted .htaccess file (rename it and regenerate by saving permalinks), plugin conflicts, PHP memory limits and server error logs in your hosting panel.

Error establishing a database connection

Verify database name, user, password and host in wp-config.php, check whether the database server is down with your host and repair the database if tables are corrupted.

404 errors on posts

Go to Settings > Permalinks and click Save to regenerate rewrite rules. Check .htaccess permissions.

Memory exhausted

Increase the memory limit in wp-config.php (for example define('WP_MEMORY_LIMIT', '256M');) or ask your host, then find the plugin using excessive memory.

Stuck in maintenance mode

Delete the .maintenance file in the site root after a failed update, then rerun the update.

Login redirect loop

Clear cookies and cache, check site URL settings, disable plugins and regenerate .htaccess.

Updates failing

Check file permissions, available disk space and PHP version, and try updating manually.

When to get help

If errors persist, the site shows signs of hacking or it's a busy store losing sales, get professional help quickly.

Quick reference table

ErrorMost common causeFirst thing to try
White screenPlugin or theme fatal errorRename plugins folder
500 error.htaccess or PHP errorRename .htaccess, check logs
Database connectionWrong credentials or DB downCheck wp-config.php and host status
404 on postsRewrite rulesRe-save permalinks
Memory exhaustedHeavy plugin or low limitRaise memory limit
Too many redirectsSSL/URL mismatchCheck site URL and CDN SSL mode
Upload failedPermissions or size limitCheck folder permissions and upload limits

Preventing errors

Test updates on staging, keep a backup before changes, use reputable plugins, keep PHP current and monitor uptime so you know about problems before customers do.

Common mistakes when troubleshooting

  • Editing files without a backup.
  • Updating everything at once, making it hard to find the cause.
  • Leaving WP_DEBUG_DISPLAY on, showing errors to visitors.
  • Ignoring the server error log, which usually names the problem file.

Using Recovery Mode

When a fatal error occurs, WordPress emails the admin a recovery-mode link. Use it to log in safely, deactivate the faulty plugin or theme, and then investigate the cause.

Keeping an error log

Note every incident, its cause and fix. Patterns, such as repeated problems after a specific plugin's updates, help you choose more reliable tools.

Frequently asked questions

How do I access my site if the admin doesn't load?

Use your hosting file manager, FTP/SFTP or SSH to edit files and deactivate plugins.

Can a plugin update break my site?

Yes, through conflicts or compatibility issues. Test updates on staging and keep backups.

What PHP version should I use?

A currently supported version compatible with your theme and plugins.

Will fixing errors affect my content?

Troubleshooting usually doesn't touch content, but always have a backup first.

What causes "There has been a critical error on this website"?

A fatal PHP error, usually from a plugin or theme. Check the recovery-mode email WordPress sends to the admin and the debug log.

How do I prevent errors after updates?

Use a staging site, update one component at a time, keep backups and choose actively maintained plugins.

Sources and further reading

S
Eng. Mohamed Sakr

Founder of Sakr Web (usaker) and msaker.com. Web and mobile app developer and SEO and digital marketing specialist with 15+ years of experience building projects for clients in Egypt, the Gulf and beyond.

Need help putting this into practice?

Sakr Web builds and grows websites, stores and apps: design, speed, security, SEO and ads.

Ready to grow online?

Website, store, app, SEO or marketing: a free plan and quote within 24 hours.

Call usFast reply

Talk to us directlyDaily

+20 100 006 2434Main line
+20 110 070 0484Sales & support