Bug FixesAugust 2, 20268 min read

WordPress 500, 502, and 503 errors: what each one means and how to fix it (without calling your host).

A 500 error is not the same as a 502 or a 503. They mean different things, have different causes, and need different fixes. Here is how to tell them apart and what to do about each one.

You load your WordPress site and see a white page with a number. 500. Or 502. Or 503. They all look like "site is broken" but they mean completely different things, and the fix for one will not fix the others.

Here is what each error actually means, what causes it, and what to do about it. I have seen each of these hundreds of times across the 50+ sites I maintain.

500 Internal Server Error

This is the vaguest error. It means "something went wrong on the server, and I am not going to tell you what." Thanks, server.

What causes it:

  • A PHP fatal error (the most common cause in WordPress)
  • A corrupted .htaccess file
  • PHP memory limit exceeded
  • Incompatible PHP version (your host upgraded PHP and an old plugin broke)
  • A plugin or theme calling a function that does not exist

How to fix it:

First, check if it is .htaccess. Rename .htaccess to .htaccess-old via FTP, then go to Settings - Permalinks and click Save Changes. WordPress will generate a fresh .htaccess. If the site comes back, that was the problem.

If that does not work, it is probably a PHP fatal error. Enable WP_DEBUG in wp-config.php:

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

Reload the site, then check wp-content/debug.log. The error will name the file and line that failed. Usually it is a plugin. Rename that plugin's folder via FTP to deactivate it. Site comes back? You found it.

If the error mentions "memory limit," add this to wp-config.php, before the line that says /* That's all, stop editing! */:

define( 'WP_MEMORY_LIMIT', '256M' );

This is also covered in more detail in my guide on WordPress white screen and critical errors.

502 Bad Gateway

A 502 means your server (or more accurately, your reverse proxy, like Nginx) tried to talk to PHP, and PHP did not respond properly. Think of it as the proxy saying "I asked PHP for a response, and PHP sent me garbage."

What causes it:

  • PHP crashed or ran out of memory and the PHP-FPM process died
  • The server is overloaded (too many concurrent visitors, a bot scraping your site, a DDoS)
  • A plugin is stuck in an infinite loop, eating all CPU
  • PHP-FPM service is down (hosting issue)
  • Timeout: PHP took too long to respond (complex query, large import, heavy WooCommerce checkout)

How to fix it:

First, check if it is temporary. Wait 2-3 minutes and reload. If it was a traffic spike, the site may come back on its own.

If it persists, it is likely a plugin consuming all resources. Disable all plugins via FTP (rename /wp-content/plugins/ to /wp-content/plugins-old/). If the site loads, re-enable plugins one by one until the 502 returns. The last one you enabled is the culprit.

If disabling plugins does not help, it is a server-level issue. Check if PHP-FPM is running (on a VPS: systemctl status php8.2-fpm). On shared hosting, contact your host and tell them "I am getting a 502 Bad Gateway, can you check if PHP-FPM is running for my account?"

503 Service Unavailable

A 503 means the server is up but cannot handle your request right now. It is the server equivalent of "I am busy, try again later."

What causes it:

  • Server is under maintenance (your host is updating something)
  • Resource limits hit (CPU, RAM, or process limits on shared hosting)
  • Too many concurrent connections
  • A caching plugin is rebuilding its cache and the server is overloaded
  • On managed WordPress hosting (WP Engine, Kinsta): the site exceeded its plan limits

How to fix it:

If you are on shared hosting, a 503 often means you outgrew your plan. Too many visitors, too many plugins, or a viral post. Check your resource usage in cPanel (Resource Usage - Live). If you are hitting your CPU or memory limit regularly, it is time to upgrade to a VPS or managed WordPress host.

If it is intermittent (happens during traffic spikes), enable aggressive caching. A good caching setup can cut server load by 80%. I cover this in my speed optimization service.

If you are on WP Engine or Kinsta, check their status page. Sometimes the 503 is on their end. If it is your site hitting limits, they will tell you in the dashboard.

Quick reference: which error is which?

  • 500: Something broke in the code (PHP error, .htaccess, memory limit). Fix the code.
  • 502: PHP crashed or is not responding. Fix the process or find the plugin eating CPU.
  • 503: Server is overwhelmed or under maintenance. Reduce load or upgrade hosting.

When to call your host vs when to fix it yourself

Fix it yourself if: the error is caused by a plugin, a theme, .htaccess, or a PHP memory limit. These are all in your control.

Call your host if: the error persists after disabling all plugins, PHP-FPM is down, or the issue started right after a host-side change (PHP upgrade, server migration). These are in their control.

If you are getting 500/502/503 errors and need help diagnosing, message @wpservicelab on Telegram. I can usually tell you which one it is and what to do within 10 minutes. See my bug fix service for pricing.

Have a site to recover?

Send the domain and a Wayback link. Honest scope and price before any work starts.

Get a quote