You open Google Search Console, check the Page indexing report, and there it is: "Server error (5xx)". A group of your URLs is listed under it, and Google is telling you it tried to crawl those pages but your server answered with an error instead of the page. The pages are not blocked, they are not missing, and they are not low quality — your server simply failed to deliver them when Googlebot knocked.
This is one of the more urgent errors in Search Console, because it is entirely on your side of the fence. Googlebot will retry a 5xx URL a few times, but if the error persists, the affected pages drop out of Google's index and stop appearing in search results. The good news is that the cause is usually findable in minutes: a crashed plugin, a server that ran out of memory, a bad deployment, or a host having a bad day. This guide explains what the error means, which 5xx code is behind it, how to diagnose it step by step, and how to fix each cause — including the special case where the 5xx is on your robots.txt file itself.
What "Server error (5xx)" actually means
When Googlebot crawls a URL, it sends an HTTP request to your server and waits for a response. The first digit of the status code your server returns tells Google what happened. A 2xx code means success. A 3xx code means the page moved. A 4xx code means the page is missing or forbidden. A 5xx code means the server itself failed: it understood the request, but something went wrong on its side while trying to answer it.
Search Console groups all of these under one reason in the Page indexing report: "Server error (5xx)". It only lists URLs that Google found in a sitemap or through links and then failed to fetch because of a server error. Click the reason and you get the list of affected URLs, the date Google first saw the error, and a trend chart showing whether the problem is growing or shrinking.
The error does not mean Google penalised your site. A 5xx is a technical failure, not a quality judgement. But it has a real cost: while the error stands, Google cannot crawl the page, cannot refresh its content, and — if the error lasts — will eventually remove the page from its index. A handful of URLs on a large site is a nuisance. A site-wide 5xx is an emergency, because it means Googlebot cannot reach anything at all.
The 5xx codes you will actually see
Not all server errors are the same, and the exact code tells you where to look. These four cover almost every case you will meet:
- 500 Internal Server Error — the catch-all. The server hit an unexpected condition and could not complete the request. On WordPress sites this is usually a broken plugin, a theme error, or a bad line in .htaccess. On custom apps it is usually an unhandled exception in the code.
- 502 Bad Gateway — the server acting as a gateway or proxy got an invalid response from the server behind it. Common when a reverse proxy such as Nginx or Cloudflare cannot reach your origin server, or when PHP-FPM has crashed while the web server is still running.
- 503 Service Unavailable — the server is temporarily unable to handle the request, usually because it is overloaded, under maintenance, or restarting. A 503 is the only 5xx code that explicitly means "try again later", and it is the correct code to serve during planned maintenance.
- 504 Gateway Timeout — the gateway waited for the origin server and gave up. The page or script took too long: a slow database query, an external API call that never returned, or a server so overloaded that requests queue until they time out.
Search Console does not always show you which of these four it saw, so part of the diagnosis is reproducing the error yourself and reading the exact code. The fix for a 500 is very different from the fix for a 503, so do not skip that step.
Why the error happens
Almost every 5xx comes down to one of these causes. Finding yours decides which fix to use.
A broken plugin, theme, or code deployment. The most common cause on WordPress and similar platforms. A plugin update introduces a fatal PHP error, a theme file references a missing function, or a deployment ships code that crashes on certain pages. The homepage may still work while the affected pages — often the ones using a particular template — return 500.
The server ran out of resources. PHP memory limits, database connection limits, and worker process limits are all finite. A traffic spike, a runaway cron job, or a plugin that opens dozens of database connections can exhaust them, and the next request fails with a 500 or 503. Shared hosting is especially prone to this: your neighbours' traffic can eat the resources your site needs.
The database is down or unreachable. If the database server stops, restarts, or refuses connections, every page that needs data fails. WordPress shows "Error establishing a database connection" to visitors; Googlebot gets a 500. A wrong database password after a migration, or a database server that crashed, produces the same result.
A reverse proxy or CDN cannot reach your origin. If you use Cloudflare, Nginx, or a load balancer in front of your site, a failure between the proxy and the origin produces 502 or 504 errors. The proxy itself is fine — the server behind it is not answering, or is answering too slowly.
Maintenance mode or a server restart. A 503 during a deployment, a server reboot, or a host migration is normal and usually harmless if it lasts minutes. It becomes a problem when maintenance mode gets stuck on, or a restart fails and the server never comes back properly.
A misconfigured .htaccess or server config. A syntax error in .htaccess, a bad rewrite rule that loops, or a directive your server does not understand can turn a whole directory — or the whole site — into 500 errors. This often appears immediately after an edit, which makes it easy to trace if you remember what changed.
The robots.txt file itself returns a 5xx. This is a special case with outsized consequences. If Googlebot requests your robots.txt and gets a 5xx, Google treats it as a temporary failure and pauses crawling of your entire site until it can fetch the file again. A single broken robots.txt can therefore look like a site-wide crawl shutdown. Always check the robots.txt fetch separately.
How to diagnose it step by step
Work through these steps in order. The aim is to answer three questions: is the error on one page or the whole site, which exact code is it, and what changed just before it started?
- Open the Page indexing report in Search Console and click "Server error (5xx)". Look at the URL list. Are the affected URLs a random handful, one section of the site, or everything? A single section points at a template or plugin; everything points at the server or the database. Note the date the error first appeared and compare it with anything you changed that day — a plugin update, a deployment, a host migration.
- Run URL Inspection on one affected URL and click "Test live URL". This shows you exactly what Googlebot sees right now, including the HTTP response code. If the live test passes with a 200, the error was temporary and may already be clearing — note the date and keep watching. If it fails, the response code tells you which of the four codes above you are dealing with.
- Open the same URL in your own browser. If it loads fine for you but fails for Googlebot, the problem may be specific to crawlers: a firewall rule, a bot-protection challenge, or a server that only fails under Googlebot's user-agent. If it fails for you too, the problem is general and easier to reproduce.
- Check whether the whole site is down or just those URLs. Load your homepage and two or three unrelated pages. If everything fails, the fault is at server level — database, PHP, hosting. If only the listed URLs fail, the fault is narrower: a template, a plugin that only runs on those pages, or a redirect rule that only matches those paths.
- Check your robots.txt file with the free bulk robots.txt tester. Use Live Fetch Mode to pull your live robots.txt, then paste the affected URLs into the Test URLs box with Googlebot selected and click "Run Bulk Evaluation". If Live Fetch itself fails, that is a strong signal: a 5xx on robots.txt makes Google pause crawling site-wide, and it is often the first thing to check when many URLs fail at once. If the tester shows the URLs as Allowed, robots.txt is not the problem and you can rule it out.
- Read your server error log. On shared hosting this is in your hosting panel under Error Logs; on a VPS it is usually /var/log/apache2/error.log or /var/log/nginx/error.log. Search for entries timestamped when Googlebot hit the error. A PHP fatal error names the exact file and line that crashed — that is the fastest route to a fix. No log entries at all usually means the request never reached your application, which points at the proxy, the host, or the network instead.
- Check your host's status page and your resource usage. Look for an outage notice, and check CPU, memory, and database connections in your hosting panel around the time the errors began. A host outage or a resource spike that lines up with the error start time is your answer. If you recently changed hosting plans, moved servers, or edited DNS, check that the move completed cleanly.
How to fix it
Match the fix to the code you found in step 2. Do not guess — applying the wrong fix wastes the crawl budget Google spends retrying your pages.
For a 500 Internal Server Error: read the error log first; it usually names the culprit. On WordPress, deactivate the most recently updated plugin and test the URL again. If the error disappears, you have found it — update, replace, or remove that plugin. Check .htaccess by renaming it temporarily: if the site works without it, a bad rule is the cause, so restore the file and remove the offending lines. If the log shows a PHP memory error, raise the memory limit in wp-config.php or php.ini — but treat that as a bandage: find out why the page needs so much memory.
For a 502 Bad Gateway: restart PHP-FPM and your web server, then check that the origin server is actually running. If you use Cloudflare, check whether the error appears with Cloudflare paused — if it does not, the problem is between Cloudflare and your origin, often a firewall blocking Cloudflare's IP ranges or an origin that stopped answering. If the error appears only under traffic spikes, your PHP worker pool is too small for the load.
For a 503 Service Unavailable: first check whether maintenance mode is stuck on — a leftover .maintenance file on WordPress, or a deployment that never finished, will serve 503 to every visitor and every crawler. If the server is genuinely overloaded, reduce the load: disable heavy plugins, enable caching so fewer requests reach PHP, and check for runaway cron jobs or backup tasks running during peak hours. If the 503 was planned maintenance, make sure it ended cleanly and that the server returns 200 again.
For a 504 Gateway Timeout: find the slow step. A page that queries the database thousands of times, calls an external API on every load, or generates a huge uncached response will time out under a proxy's limit. Enable caching for the affected pages, add an index to the slow database query, or move the slow work — image processing, feed generation, report building — into a background job instead of doing it inside the page request.
For a 5xx on robots.txt: fix the file's delivery before anything else. A 5xx here pauses crawling of the whole site, so it outranks individual page errors. Check that the robots.txt file is a plain static file at the domain root, not generated by a plugin that can crash. Test it with the bulk robots.txt tester in Live Fetch Mode: if the fetch succeeds and the rules evaluate correctly, Googlebot will be able to fetch it too.
After any fix, validate your sitemap. A server error can leave stale or broken entries behind, and a sitemap that still lists dead URLs will generate fresh errors. Run it through a sitemap validator and remove any URL that still fails, then resubmit the clean sitemap in Search Console.
After the fix: ask Google to recheck
Fixing the server is only half the job — you also need to tell Google the error is gone. In Search Console, open the "Server error (5xx)" reason and click "Validate Fix". Google re-crawls a sample of the affected URLs over the following days and marks the issue as passed when they return 200. Do not use Validate Fix until you have confirmed the fix yourself with a live test, or you will burn a validation cycle on URLs that still fail.
For an important page, you can also use URL Inspection and click "Request Indexing" after the live test passes. This puts the URL in Google's priority crawl queue. Note that Google limits how many indexing requests you can make per day, so save this for the pages that matter most and let Validate Fix handle the rest.
Keep watching the report for a week after the fix. A 5xx that clears and then returns is a different problem from one that stays fixed: it usually means the underlying cause — resource exhaustion, a flaky database connection, a plugin that crashes under load — is still there and only fails when traffic peaks.
Tips to stop it coming back
- Set up uptime monitoring. A free monitor that checks your homepage every few minutes and alerts you the moment it returns a 5xx will catch the next outage in minutes instead of when you next open Search Console.
- Serve a proper 503 during maintenance. If you take the site down for work, make sure it returns 503 with a Retry-After header, not 500 and not 200. A 503 tells Google the outage is temporary and to come back later; a 500 looks like a fault, and a 200 on a "down for maintenance" page risks getting that page indexed.
- Cache aggressively. A cached page is served without touching PHP or the database, so it keeps working even when the application behind it is struggling. Full-page caching is the single most effective defence against traffic-spike 503s on WordPress and similar platforms.
- Keep a staging site for updates. Test plugin updates, theme changes, and deployments on a staging copy first. Most 500 errors arrive with an update that was never tested, and a staging test catches them before Googlebot does.
- Watch your resource limits after growth. A hosting plan that was fine at 1,000 visits a day can start failing at 10,000. If 503s appear as traffic grows, the plan — not the code — is usually the bottleneck.
- Log and review server errors weekly. A PHP warning that appears in the log today is often the 500 error of next month. A five-minute weekly check of the error log catches problems while they are still small.
Common problems
Mistaking a 5xx for a robots.txt block. "Server error (5xx)" and "Submitted URL blocked by robots.txt" are different reasons with different fixes. If the error says 5xx, the server failed — editing robots.txt will not help. If you are unsure which one you have, read our guide to fixing "Submitted URL blocked by robots.txt" and compare the symptoms before changing anything.
Deleting the URLs instead of fixing them. Removing a page that returns a 500 and taking it out of the sitemap does clear the error — but it also throws away a page Google wanted to index. If the page has traffic, links, or rankings, fix the server fault and keep the page. Deletion is the right answer only for pages you genuinely no longer want.
Assuming Google will retry forever. Googlebot does retry 5xx URLs, but not indefinitely. A page that keeps failing is eventually dropped from the index, and when you fix it later it has to earn its way back in. A persistent 5xx is not a "wait and see" problem; it is a "fix today" problem.
Confusing a 5xx with a 404. A 404 means the page is gone; a 5xx means the server failed. They need opposite responses: a 404 is fixed by restoring, redirecting, or removing the URL, while a 5xx is fixed by repairing the server. If your report mixes the two, handle them separately — our guide to fixing "Submitted URL not found (404)" covers the 404 side.
Validating the fix before testing it live. Clicking "Validate Fix" while the pages still return 500 wastes days: Google tests, the validation fails, and you have to start again. Always run URL Inspection's live test on a few affected URLs first, and only validate when they return 200.
Frequently asked questions
Does a server error (5xx) hurt my rankings?
Not directly, and not immediately. Google does not penalise a site for a 5xx — it understands servers fail. The damage is indirect: while the error stands, the affected pages cannot be crawled or refreshed, and if the error persists for weeks Google drops those pages from its index, which removes their rankings entirely. A short outage costs nothing; a long one costs the pages involved.
How long does Google wait before dropping a page that returns a 5xx?
There is no fixed deadline. Googlebot retries 5xx URLs over days and weeks, and the retry interval grows the longer the error lasts. In practice, pages that fail for a few days are fine; pages that fail for several weeks start disappearing from the index. The exact timing depends on the page's importance and how often Google normally crawls it.
Why does Search Console show a 5xx when my site loads fine for me?
Three common reasons. First, the error may be intermittent — the server fails under load and works when you test it quietly. Second, the fault may be specific to crawlers, such as a firewall rule or bot protection that challenges Googlebot but not your browser. Third, the error may already be fixed, and Search Console is showing you the history from when it happened — check the live test in URL Inspection to see the current state.
Is a 503 during maintenance bad for SEO?
No, if it is done correctly. A 503 with a Retry-After header is the correct way to signal temporary downtime, and Google handles it gracefully — it simply comes back later. What hurts is a 503 that lasts for days, a maintenance page that returns 200 instead of 503, or a maintenance mode that gets stuck on after the work is done. Keep maintenance short and verify the site returns 200 when you finish.
Can a 5xx on robots.txt really block my whole site?
Yes. If Googlebot requests robots.txt and gets a 5xx, Google assumes the failure is temporary and pauses crawling of the site until the file can be fetched again. That is why a robots.txt fetch error is more serious than a 5xx on a single page. Make sure robots.txt is a plain static file at your domain root, and test it with the free bulk robots.txt tester after any server change.
Bottom line
"Server error (5xx)" means your server failed to answer Googlebot — nothing more mysterious than that. Find the exact code with a live test, match the fix to the cause, and check the error log before you guess. A 500 usually points at broken code or a plugin, a 502 at the proxy or PHP-FPM, a 503 at overload or stuck maintenance mode, and a 504 at a page that is simply too slow. Fix the cause, confirm the pages return 200, validate the fix in Search Console, and keep an eye on the report for a week. Most 5xx errors are fixed in under an hour once you know where to look — and the sites that recover fastest are the ones whose owners check the error log first instead of waiting for Google to try again.



