HTTP Status Codes for SEO: A Field Guide

Not a list of codes, a list of situations. Which status to return for an out of stock product, an expired job, a seasonal page, a deleted account and a site under maintenance, and what each choice tells a crawler.

Everybody knows what a 404 is. Almost nobody is confident about what to return when a product goes out of stock for three weeks, or when a job listing expires, or when a seasonal page is irrelevant for nine months of the year.

Those are the decisions that actually arise, and they get made by whoever is writing the code that afternoon, usually by choosing whatever is easiest. This is a field guide organised by situation rather than by number.

The short version of what each code says

Before the situations, the vocabulary. A status code is a statement to a crawler about what this URL is and whether to come back.

200 Here is the content. Index it.
301 This moved permanently. Use the new URL from now on.
302 or 307 This is temporarily elsewhere. Keep the original URL.
304 Nothing has changed since you last asked. Saves everyone the download.
404 Not here. Might come back, might not.
410 Gone deliberately. Not coming back.
429 You are asking too often. Slow down.
451 Unavailable for legal reasons.
500 Something broke. No information about whether it will be fixed.
503 Temporarily unavailable, deliberately. Come back later.

The distinction that matters most is between codes that mean come back and codes that mean do not. Everything below is an application of that.

The situations, and what to return

A product is out of stock but will return. Keep the URL on 200. The page still describes a real product and still answers the query. Say clearly that it is out of stock, offer notification when it returns, and link to alternatives. Returning 404 for temporary unavailability throws away everything the page has earned, and you will rebuild it from zero when stock arrives.

A product is discontinued. If there is a genuine successor, 301 to it. If there is not, keep the page on 200 explaining that it is discontinued and linking to the category, or return 410 if the page has no value and no links. The worst option is a silent 301 to the home page, which tells a user nothing and is usually treated as a soft 404 anyway.

A job listing expires. 404 or 410 is correct once the role is genuinely closed, because the page no longer answers the query and leaving an expired listing live is a poor experience. If you post similar roles regularly, consider keeping a 200 page that says the role has closed and lists current openings instead.

A seasonal page is out of season. Keep it on 200 all year. A page about a festival offer or a summer programme accumulates signals over years, and killing it each year means starting again each year. Update it to say when the next one is, rather than removing it.

A user profile or listing is deleted by its owner. 410 is the honest answer, since it is gone deliberately and will not return. 404 works too and is processed marginally more slowly.

The site is down for deployment or maintenance. 503, with a Retry-After header giving a realistic time. This is the one case where the right code is unambiguous and the wrong one is common, because frameworks default to showing an error page on 200 or returning 500.

A page is blocked in one country for legal reasons. 451, which is specific and honest.

A URL was never valid and never will be. 404. Do not redirect random invalid URLs to the home page, which is a habit that creates soft 404s at scale.

Soft 404s, the quiet problem

A soft 404 is a page that returns 200 while telling the user nothing was found. The server says here is content and the content says there is no content.

This is the most damaging pattern in the list because it is invisible. Nothing errors, monitoring stays green, and the crawler builds up a picture of a site whose URLs claim to be pages but are not. Enough of them and the site is treated with more caution overall.

It happens most often in three places. Client-side routing, where an unmatched route renders a not-found message without the server ever returning a 404. Search results pages with no results. And category or filter pages that are empty because nothing matches.

For empty searches and empty filters, 200 is defensible as long as the page is genuinely useful, offering suggestions or alternatives. For an unmatched route, the server must return a real 404. We went through detection at scale in 404s and soft 404s at scale.

Redirects: the two things that go wrong

Chains. A URL redirecting to a URL that redirects again. Each hop costs a request, and a long chain may not be followed to the end in one visit. Chains form naturally over years as one migration redirects to another. Flatten them so every old URL points directly at the final destination. The tooling for this is in redirect management at scale.

Redirecting to the wrong thing. The temptation during a migration is to send everything without an obvious match to the home page. That is read as a soft 404 and you lose the signals anyway. Redirect to the closest genuinely relevant page, or let it 404 honestly. An honest 404 is better than a dishonest 301.

On permanent against temporary: use 301 when the move is permanent and 302 or 307 when it is not. Both pass signals, but the code tells the crawler which URL to treat as canonical, and a permanent move marked temporary leaves the old URL in the index indefinitely.

Server errors affect more than the page

5xx responses are not just a failure for the affected URL. A site returning errors during crawling gets crawled less, because a crawler that appears to be causing problems backs off. For a site already short of crawl allowance, an hour of 500s is expensive beyond the pages involved. Crawl budget explained covers how that allocation works.

This is why 503 during planned maintenance matters. It says this is deliberate and temporary, and crawling resumes normally afterwards. A 500 says something is broken and invites caution.

Sustained 503 is different from brief 503. A few hours is routine. Days of it and the pages start dropping out, which is correct behaviour on the crawler’s part.

The codes that save you crawl budget

Two are worth implementing and routinely are not.

304 Not Modified. If you handle conditional requests properly, a crawler asking whether a page has changed gets a tiny response instead of the full page when it has not. On a large site this is a meaningful saving, and it costs nothing but correct header handling.

Correct Last-Modified dates. Related, and frequently wrong. A content system that reports the current time as the modification date on every request destroys the usefulness of conditional requests entirely, and tells the crawler that your entire site changes constantly.

What is a waste of effort

Agonising over 404 against 410. The difference is small. Use 410 when you know it is deliberate, 404 otherwise, and move on.

Customising your error page to the point of hiding that it is an error. A helpful 404 page with search and navigation is good. One that looks like a normal page is a soft 404 waiting to be classified as one.

Redirecting 404s automatically to a search results page for the URL text. It produces thin pages at scale and is usually worse than the 404.

Monitoring only for 5xx. The expensive problems in this list are 200s that should not be, and no uptime monitor will ever flag one.

A sensible order of work

  1. Crawl your own site and list every URL by status code. Most teams have never done this and find surprises immediately.
  2. Find the soft 404s: pages returning 200 with not-found or empty content.
  3. Flatten every redirect chain to a single hop.
  4. Check that your maintenance mode returns 503 with Retry-After, not 200 or 500.
  5. Decide and document your policy for out of stock, discontinued and expired content, so it stops being decided per ticket.
  6. Verify conditional requests and Last-Modified are working.
  7. Add status codes to your monitoring, including a watch for sudden increases in 404s after a deployment.

Related decisions about blocking and canonicalising sit in robots.txt, noindex or canonical, and the migration-specific version is in the website migration checklist.

If you want a crawl run across your site with the status code picture mapped out, get in touch.