What Are 5xx Server Errors? Causes and Fixes

A 404 says a page doesn't exist; a 5xx says your server broke. These are the errors that take a site down without warning and quietly tell Google you're unreliable. Here's what each one means and how to fix it.

A visitor lands on your site, clicks through to the page they came for, and instead of your content they get a stark message: 500 Internal Server Error. No product. No article. No checkout. Just an error and a dead end. They don't know what went wrong, and neither, in that moment, do you, because the page that worked perfectly an hour ago is now throwing the kind of error that takes your whole site down without warning.

5xx errors are the most serious class of web error, because they mean the problem is on your side. A 404 says "this page doesn't exist." A 5xx says "something on the server broke." For visitors it's a closed door. For Google, repeated 5xx errors are a signal that your site is unreliable, and that's a signal you don't want to send. This guide explains what each 5xx code means, what causes them, and how to find and fix them before they cost you traffic and rankings.

What is a 5xx server error?

HTTP status codes are grouped into families by their first digit. The 5xx family covers errors where the server received a valid request but failed to fulfill it. The fault lies with the server, not the visitor or their browser.

This is the key distinction from the more familiar 4xx family. A 4xx error (like the famous 404) means the client side made a request the server couldn't satisfy, usually a page that doesn't exist. A 5xx error means the request was fine, but the server itself failed to deliver a response. One is "you asked for something that isn't there." The other is "I broke while trying to give you what you asked for."

That difference matters for how you respond. A 404 is often expected and routine. A 5xx is almost always something you need to investigate, because it means part of your infrastructure isn't working.

The common 5xx codes and what they mean

500 Internal Server Error

The catch-all. A 500 means something went wrong on the server, but the server can't or won't be more specific. It's the generic "something broke" code. The cause could be a bug in your application code, a misconfigured server, a corrupt file, a failed database query, or a dozen other things. Because it's so vague, a 500 is a starting point for investigation, not a diagnosis.

502 Bad Gateway

A 502 appears when one server, acting as a gateway or proxy, gets an invalid response from another server upstream. This is common in setups with a reverse proxy, load balancer, or CDN sitting in front of your application server. If the upstream server is down, overloaded, or returning garbage, the front-facing server reports a 502. It often points to a problem between your infrastructure layers rather than in your application itself.

503 Service Unavailable

A 503 means the server is temporarily unable to handle the request. The two most common reasons are that the server is overloaded with traffic, or that it's down for maintenance. The "temporary" part matters: a 503 is the polite way to say "try again shortly." It's also the correct code to return deliberately during planned maintenance, paired with a Retry-After header so crawlers know to come back later rather than treating the outage as permanent.

504 Gateway Timeout

A 504 is like a 502, but specifically a timeout. A gateway or proxy server waited for a response from an upstream server and didn't get one in time. This usually means the upstream server is too slow, overloaded, or stuck on a long-running process like a heavy database query. Where a 502 is "I got a bad answer," a 504 is "I got no answer fast enough."

Other codes you might see

You may occasionally encounter a 507 (Insufficient Storage), a 508 (Loop Detected), or host-specific codes like Cloudflare's 520-526 range, which describe various failures between Cloudflare and your origin server. The big four above account for the vast majority of cases.

What causes 5xx errors

5xx errors come from a wide range of root causes, but most fall into a few categories:

  • Traffic spikes and overload. A sudden surge of visitors, a viral post, or a marketing campaign can overwhelm a server that isn't provisioned for it, producing 503s and 504s.
  • Application bugs. A coding error, an unhandled exception, or a bad deploy can throw 500s across affected pages.
  • Database problems. A database that's down, slow, or maxed out on connections is a frequent source of 500s and 504s.
  • Server misconfiguration. A broken .htaccess rule, a bad Nginx config, wrong file permissions, or an exhausted PHP memory limit can all trigger 500s.
  • Resource exhaustion. Running out of memory, CPU, disk space, or available worker processes.
  • Upstream and third-party failures. A failing API, an overloaded origin behind a CDN, or a down microservice can cascade into 502s and 504s.
  • Faulty plugins or extensions. On platforms like WordPress, a single bad plugin update is a classic cause of a sitewide 500.

Why 5xx errors hurt your SEO

5xx errors aren't just a user-experience problem. They actively damage how search engines see your site.

Crawling stops

When Googlebot repeatedly hits 5xx errors, it interprets your site as unstable. Google may slow its crawl rate to avoid making the problem worse, which means new and updated content gets discovered and indexed more slowly. If the errors are widespread and persistent, Google can eventually start dropping affected pages from its index.

Rankings can slip

A page that consistently returns a 5xx can't be served to searchers, and Google won't keep ranking a page it can't reliably reach. Brief, occasional errors are usually forgiven, but sustained server problems can cost you positions you worked hard to earn.

The damage is invisible until it isn't

Here's the insidious part: server errors are often intermittent. A page might throw a 500 under load and work fine the rest of the day. You test it, it's fine, so you assume everything's okay, while Googlebot keeps hitting the error during the exact windows you're not looking. The damage accumulates quietly.

How to find and diagnose 5xx errors

Google Search Console

Start here. The Page Indexing report flags pages that returned server errors, and the Crawl Stats report (under Settings) shows the rate of 5xx responses Googlebot has encountered over time. A rising line there is an early warning that something is wrong even if the site looks fine to you.

Server and error logs

Your server's error logs are the single most useful diagnostic tool. A 500 in the browser is vague, but the corresponding entry in the error log usually names the exact file, line, or query that failed. If you have access to your hosting control panel or server, the logs are where the real answer lives.

Uptime and monitoring tools

Because 5xx errors are often intermittent, a monitoring service that checks your site every minute and alerts you the moment it returns a 5xx is invaluable. It catches the errors that happen while you're not looking, which is exactly when the worst ones tend to strike.

Reproduce the conditions

If an error only appears under load, you may need to simulate traffic, or check whether the errors correlate with a campaign, a scheduled job, or a backup process that spikes server resources at a particular time.

How to fix common 5xx errors

The right fix depends on the cause, but a practical order of investigation:

  • Check the error logs first. They usually tell you what failed and where, turning a vague 500 into a specific, fixable problem.
  • Review recent changes. Did the errors start after a deploy, a plugin update, or a config change? Rolling back the most recent change is often the fastest fix.
  • Look at server resources. If you're hitting memory, CPU, or connection limits, you may need to optimize the offending code or upgrade your hosting.
  • For 502 and 504, investigate the upstream layer: the application server, the database, or any third-party API the page depends on. Increase timeouts or fix the slow process behind them.
  • For 503, confirm whether it's intentional maintenance or genuine overload, and scale resources or add caching if traffic is the issue.
  • Disable suspect plugins or extensions one at a time on a CMS to isolate a faulty one.
  • Contact your host if the problem sits in infrastructure you don't control. Sometimes the issue is on their end.

Where Steterly fits in

Server errors share a trait with the other quiet problems that erode a site: they don't announce themselves to the person running the site. A page throws a 500 under load while you're asleep, Googlebot hits it, and by morning everything looks normal again. The error came and went, but the crawl signal it sent did not. The only way to stay ahead of that kind of intermittent decay is to check regularly rather than assume silence means health.

Steterly is a whole-site quality scanner that crawls your site the way a search engine would and reports back on what it finds, including pages that fail to respond properly. Alongside server-side failures, it surfaces the everyday rot that quietly costs traffic and trust: broken links, missing or broken images, typos, outdated copyright years, leftover placeholder text, missing meta titles and descriptions, and Core Web Vitals issues. Running a scan at the moments that matter, after a deploy, a migration, or a traffic spike, is how you catch a problem before Google does.

You can start with a free scan of up to 50 pages, no credit card required. Create a free account, run a scan, and get a clear, prioritized report of what's failing or fading, so the errors your visitors and Google hit aren't the way you find out.

Frequently asked questions

What is the difference between a 4xx and a 5xx error?

A 4xx error means the client side made a request the server could not satisfy, most commonly a 404 for a page that does not exist. A 5xx error means the request was valid but the server itself failed to fulfill it. In short, 4xx is a problem with the request and 5xx is a problem on the server.

What does a 500 Internal Server Error actually mean?

A 500 is a generic catch-all indicating that something went wrong on the server, but the server cannot be more specific about what. The real cause could be a code bug, a failed database query, a misconfiguration, or a faulty plugin. Because it is so vague, the next step is always to check your server error logs for the specific failure.

Do 5xx errors hurt SEO?

Yes. When Googlebot repeatedly encounters 5xx errors it treats the site as unstable, slows its crawl rate, and may eventually drop affected pages from the index. Brief, occasional errors are usually forgiven, but sustained server problems can cost you rankings because Google will not reliably serve a page it cannot reach.

What is the difference between a 502 and a 504 error?

Both involve a gateway or proxy server failing to get a proper response from an upstream server. A 502 Bad Gateway means the upstream returned an invalid response, while a 504 Gateway Timeout means the upstream did not respond in time at all. A 502 is a bad answer, and a 504 is no answer fast enough.

Why do my server errors come and go?

5xx errors are often intermittent because they are triggered by conditions like traffic spikes, resource exhaustion, or slow database queries that only occur at certain times. The page can work fine when you test it and fail under load minutes later, which is why a monitoring tool that checks continuously is far more reliable than manual spot-checks.

How do I find what is causing a 5xx error?

Start with your server error logs, which usually name the exact file, line, or query that failed and turn a vague 500 into a specific problem. Then review recent deploys, plugin updates, and configuration changes, and check Search Console's Crawl Stats report to see how often Googlebot is hitting the errors over time.