Skip to content
Developers

HTTP Status Codes and SEO: How 301, 302, 404, 410 and 5xx Affect Your Rankings

PAYATE Teamยท ยท 8 min read
HPAYATE

Every time a search engine crawler requests a URL on your site, your server replies with a three-digit HTTP status code before it sends anything else. Users rarely notice these codes, but crawlers rely on them heavily. The status code tells a search engine whether the page exists, whether it has moved, whether it is gone for good, or whether your server is struggling. Get them wrong and you can end up with pages dropped from the index, ranking signals stuck on old URLs, or crawl budget wasted on errors.

This guide explains how search engines, and Google in particular based on its public documentation, interpret each class of status code, which redirect to use for a migration, how to handle removed pages and maintenance windows, and how to audit what your server is actually returning. For a full list of codes, see our HTTP status code reference.

How crawlers read the five classes of status codes

Status codes are grouped by their first digit. Each group sends a different signal to a crawler.

2xx: success

A 200 OK tells the crawler the request worked and the content in the response body is the page. Only URLs that return a 2xx status are considered for indexing in their own right. A 200 does not guarantee indexing, since the content still has to be useful and not blocked by a noindex directive, but it is the starting point.

3xx: redirection

A 3xx response tells the crawler the content lives somewhere else, given in the Location header. Google follows redirects and uses them as a signal about which URL should be canonical. Permanent redirects strongly suggest the target should replace the original in search results; temporary redirects suggest the original should stay.

4xx: client errors

A 4xx response means the request could not be fulfilled because of something on the client side, most commonly that the URL does not exist. Google does not index URLs that return 4xx codes, and if an indexed URL starts returning one, it is eventually removed from the index. Note that 429 is a special case, covered below.

5xx: server errors

A 5xx response means the server failed. Google treats these as a sign it may be crawling too hard and slows down its crawl rate. Pages that were already indexed are kept for a while, but if a URL keeps returning a server error over an extended period, Google may drop it from the index.

Redirects: 301 vs 302 vs 307 vs 308

Redirects are where status codes matter most for SEO, especially during site migrations, domain changes and URL restructuring.

Permanent redirects: 301 and 308

A 301 Moved Permanently tells crawlers the resource has moved for good. Google treats it as a strong signal that the redirect target should be shown in search results instead of the old URL. A 308 Permanent Redirect has the same meaning for search, and Google treats 301 and 308 the same way. The technical difference is that 308 requires clients to keep the original HTTP method and body, so a POST stays a POST, while 301 historically allowed clients to switch to GET. For ordinary page moves, either works; 301 is the most widely used.

Temporary redirects: 302 and 307

A 302 Found and a 307 Temporary Redirect tell crawlers the move is temporary. Google treats both as a weak signal that the target should be canonical, so the original URL usually stays in search results. Use them for genuinely temporary situations: a short-term promotion, an A/B test, or a geolocation-based redirect.

If a temporary redirect stays in place for a long time, Google may eventually decide it behaves like a permanent one. Do not rely on that. If a move is permanent, say so with a 301 or 308.

Redirects in a site migration

For a migration, map every old URL to its closest equivalent new URL with a permanent redirect. Avoid redirecting everything to the homepage: Google may treat a mass redirect to an unrelated page as a soft 404. Keep the redirects in place for a long time, at least a year according to Google's guidance on site moves, and preferably indefinitely if old links point to them. Update internal links and sitemaps to point directly at the new URLs, so the redirects serve external links and old bookmarks rather than your own navigation.

Redirect chains and loops

A redirect chain happens when URL A redirects to B, which redirects to C, and so on. Chains build up naturally over years of migrations, for example HTTP to HTTPS, then non-www to www, then an old path to a new one. Googlebot follows a limited number of hops (its documentation mentions up to 10) before giving up, and each hop adds latency for users. Point every old URL straight at its final destination. A redirect loop, where URLs redirect back to each other, means the page can never be reached and will not be indexed.

Removed pages: 404, 410 and soft 404s

404 Not Found vs 410 Gone

A 404 Not Found says nothing exists at this URL. A 410 Gone says the resource existed and was deliberately removed. For Google, both lead to the same result: the URL is dropped from the index and crawled less often over time. Google has said a 410 may be processed slightly faster, but the practical difference is small. Use 410 if your platform makes it easy and the removal is intentional; a 404 is perfectly fine otherwise.

404s are a normal part of the web. They do not harm the rest of your site's rankings. They become a problem only when they affect pages that should exist, such as important pages broken by a bad deployment, or URLs with valuable external links that should be redirected to a relevant replacement.

Soft 404s

A soft 404 is a page that tells users it does not exist, but returns a 200 OK status. Common examples are an empty search results page, a product page saying it is no longer available with no other content, or a custom error page served with a 200. Google detects many of these and reports them as soft 404s in Search Console, but it is better not to rely on detection. If a page is gone, return a real 404 or 410 with a helpful error page. If it has moved, redirect it.

Maintenance and overload: 503 and 429

503 Service Unavailable with Retry-After

For planned maintenance or temporary outages, return a 503 Service Unavailable rather than a 200 maintenance page or a 404. A 503 tells crawlers the problem is temporary, so they come back later instead of indexing a placeholder page or treating your content as removed. Add a Retry-After header with a number of seconds or an HTTP date to indicate when to try again. Crawlers treat it as a hint rather than a promise.

Keep 503 responses short. A day or two of 503s is generally handled gracefully, but if Google keeps seeing server errors for an extended period, it may start dropping URLs from the index, exactly as with other persistent 5xx errors.

429 Too Many Requests

If a crawler is putting too much load on your server, returning 429 Too Many Requests (or a 503) tells Googlebot to slow down. Google treats 429 like a server error for crawl-rate purposes rather than as a normal 4xx, and it reduces its crawl rate in response. This is meant as a short-term measure. Serving 429s or 5xx errors for a long time can lead to the same deindexing effect as an outage, so fix the underlying capacity problem rather than relying on rate limiting indefinitely.

Status codes and their SEO effect at a glance

CodeMeaningTypical SEO effect
200OKPage is eligible for indexing (content still has to qualify)
301Moved PermanentlyStrong signal that the target URL should be canonical
308Permanent RedirectTreated the same as 301 by Google
302FoundWeak canonical signal; original URL usually stays indexed
307Temporary RedirectTreated like 302 by Google
404Not FoundURL dropped from the index over time; no penalty for the site
410GoneSame as 404, possibly processed slightly faster
429Too Many RequestsCrawl rate reduced; persistent use can lead to deindexing
500Internal Server ErrorCrawl rate reduced; long-standing errors can lead to deindexing
503Service UnavailableTemporary; use with Retry-After for maintenance, keep it brief

How to audit your status codes

The fastest way to see what a URL really returns is to request just the headers from the command line with curl. The -I flag sends a HEAD request and prints the response headers:

curl -I https://example.com/old-page

HTTP/2 301
location: https://example.com/new-page
content-type: text/html; charset=UTF-8

To follow a redirect chain and see every hop, add -L:

curl -sIL https://example.com/old-page | grep -iE "^(HTTP|location)"

Each HTTP line is one hop. If you see more than one 3xx before the final 200, you have a chain worth flattening. Note that a few servers respond differently to HEAD than to GET; if the results look odd, try curl -s -o /dev/null -w "%{http_code}" URL to check the status of a normal GET request.

Beyond spot checks, a practical audit usually includes:

  • Search Console reports: the page indexing report lists URLs excluded because of 404s, soft 404s, redirects and server errors, and the crawl stats report shows response codes Googlebot received.
  • A site crawl: crawl your own site to find internal links pointing at redirects or 404s, then update the links.
  • Server logs: logs show exactly what status codes crawlers received, including intermittent 5xx errors that a one-off check would miss.
  • Header inspection: check related headers such as Location, Retry-After, Cache-Control and X-Robots-Tag. Our HTTP headers reference explains what each one does.

Common mistakes to avoid

  • Serving error pages with a 200: creates soft 404s and can get placeholder content indexed.
  • Using 302 for permanent moves: slows consolidation onto the new URL.
  • Redirecting all removed pages to the homepage: often treated as soft 404s and frustrating for users.
  • Leaving long redirect chains: adds latency and risks crawlers giving up.
  • Blocking redirected or removed URLs in robots.txt: if crawlers cannot fetch a URL, they cannot see its redirect or 404 status.
  • Long maintenance windows on 503: fine for hours, risky for weeks.

Status codes are one of the few parts of SEO you control completely. A quick audit after every migration, redesign or platform change catches most problems before they show up in your traffic. For definitions, causes and fixes for individual codes, browse our HTTP status codes tool.

Frequently asked questions

Is a 301 or a 302 better for SEO?
Use a 301 or 308 when a page has moved permanently, because Google treats it as a strong signal that the new URL should replace the old one in search. Use a 302 or 307 only for genuinely temporary redirects, where you want the original URL to stay indexed.
Do 404 errors hurt my rankings?
Not for the rest of your site. Google simply drops URLs that return 404 from its index over time. 404s are only a problem when they affect pages that should exist or URLs with valuable links that should be redirected to a relevant replacement.
Should I use 404 or 410 for deleted pages?
Either is fine. Google treats them very similarly, and a 410 may be processed slightly faster. Use 410 if your platform supports it easily and the removal is intentional.
What status code should my site return during maintenance?
Return 503 Service Unavailable, ideally with a Retry-After header. This tells crawlers the outage is temporary. Keep it short, because server errors that last a long time can lead to pages being dropped from the index.
How can I check which status code a URL returns?
Run curl -I followed by the URL to see the response headers, or curl -sIL to follow every redirect hop. Search Console and your server logs show the codes Googlebot actually received.

Try the tools

P
Written by PAYATE Team

The PAYATE team builds free tools for merchants and developers.

More PAYATE tools