Skip to content

Maintenance mode and SEO: use 503 with Retry-After, not 200

How to put a site into maintenance mode without hurting crawling: return 503 with Retry-After, keep robots.txt at 200, and know how long Google says is safe.

By Crawlito · 6 min read

In short

  • A maintenance page should return HTTP 503 Service Unavailable, ideally with a Retry-After header, so crawlers know the outage is temporary.
  • A maintenance page served with 200 tells crawlers the page's content is now the maintenance message, and Google may report it as a soft 404.
  • Google describes disabling a whole site as something for a very short period, a few days at most, and says persistent 5xx errors lead to URLs being dropped.
  • Never return 503 for robots.txt: Google says that blocks all crawling, and RFC 9309 tells crawlers to assume complete disallow on 5xx.
  • Redirecting every URL to one maintenance page loses each page's status and can look like a site-wide move.
On this page

Put a site into maintenance mode by returning HTTP 503 Service Unavailable on the affected pages, with a Retry-After header saying when to come back. Keep /robots.txt serving its normal file with a 200. Google describes a 503 for the whole site as acceptable for a very short period, "a few days at most"; for anything longer it recommends keeping a real page online instead.

The two common alternatives, a maintenance page served with 200 and a redirect of every URL to /maintenance, both tell crawlers something false. This guide shows what each option communicates, how to configure a correct 503 on common stacks, and how to test it before you need it.

Why 503 is the right status for maintenance

HTTP status codes are how a server tells a crawler what happened. A 503 says "this page exists, but I cannot serve it right now". RFC 9110 defines it as a temporary overload or scheduled maintenance that is likely to be fixed after some delay, and says the server may send Retry-After to suggest how long to wait.

Google's documentation on HTTP and network errors explains what Googlebot does with it: it decreases the crawl rate for the site in proportion to the number of URLs returning the error, and increases it again gradually once the server returns 2xx. URLs that keep returning server errors are eventually dropped from the index. That is exactly the behaviour you want for a short outage: back off, come back later, keep the page.

The AI crawler operators do not document their 503 handling in the same detail. A 503 is still the clearest signal you can send them, and it avoids the worst outcome, which is a crawler storing your maintenance message as the content of every page.

What goes wrong with the alternatives

ApproachWhat the crawler concludesRisk
503 + Retry-After on pages, robots.txt at 200Temporary outage, retry laterLow for a short window
Maintenance page with 200The page's content is now "we'll be back soon"Snippets and AI answers built from the wrong text; Google may flag a soft 404
302 redirect of every URL to /maintenanceEvery page temporarily points to one URLStatus of individual pages lost; on long outages it can resemble a site move
301 redirect to the homepageThe pages moved permanentlyGoogle treats it as a permanent signal; real content can drop out
503 on robots.txt tooCrawling must stopGoogle says this "blocks all crawling"
Taking the server offline (timeouts, DNS errors)Site unreachableTreated as server errors, with less control than a clean 503

The 200 maintenance page

This is the default in many page builders and "coming soon" plugins. Google says a page returning 200 is processed as content, and a page whose content looks like an error is reported as a soft 404. Crawlers that do not do that analysis simply keep the text. If an AI crawler fetches your pricing page during the outage and gets "Down for maintenance" with a 200, that is what it has for the page until it fetches it again. Our guide to soft 404 pages covers this pattern in more detail.

Blanket redirects

Redirecting everything to one maintenance URL is common because it is easy to set up at a load balancer. The cost is that every URL loses its own status, and you are asking crawlers to treat thousands of pages as pointing at one. If the redirect is a 301, Google's redirects documentation says the indexing pipeline uses it as a signal that the target should be canonical. If you must route traffic to a maintenance page, serve the maintenance content in place, at the original URL, with a 503.

How long can a site return 503?

Google's guidance on pausing an online business gives the clearest numbers:

  • For an urgent closure of one to two days, return "an informational error page with a 503 HTTP response status code" instead of all content.
  • Disabling the whole site is "an extreme measure" that should only be taken for "a very short period of time (a few days at most)".
  • While pages return 503, Google cannot refresh titles, descriptions, metadata or structured data.
  • For longer closures, Google recommends keeping the site online, with limited functionality if needed, rather than serving 503s.

Google does not give an exact number of days after which 503 URLs are removed; it says persistently failing URLs are eventually dropped. Plan for hours, accept a day or two in an emergency, and treat anything longer as a reason to keep a real site up.

Why robots.txt must stay at 200

This is the most damaging mistake, because maintenance tools often apply the 503 to every path. RFC 9309 says that when robots.txt returns a server error, crawlers "MUST assume complete disallow". Google stops crawling for the first 12 hours of robots.txt errors and then falls back to its last cached copy, and its pause guidance states that returning 503 for robots.txt blocks all crawling.

The result is that a one-hour maintenance window can pause crawling of the whole host for longer than the outage itself. Exempt /robots.txt from the maintenance rule so it keeps serving the normal file. Our guide to robots.txt 404 and 5xx errors explains each status in detail.

How to return a proper 503 with Retry-After

Retry-After takes either a number of seconds or an HTTP date:

http
HTTP/1.1 503 Service Unavailable
Retry-After: 3600
Content-Type: text/html; charset=utf-8
Cache-Control: no-store

Google recommends sending it "with a best effort date or duration". Add Cache-Control: no-store so a CDN does not cache the maintenance page and keep serving it after you are back.

Nginx

Toggle maintenance with a flag file and exempt robots.txt:

nginx
location = /robots.txt {
    try_files $uri =404;
}

location / {
    if (-f /var/www/maintenance.flag) {
        return 503;
    }
    try_files $uri $uri/ /index.php?$args;
}

error_page 503 @maintenance;
location @maintenance {
    add_header Retry-After 3600 always;
    add_header Cache-Control "no-store" always;
    root /var/www/maintenance;
    rewrite ^ /index.html break;
}

Create /var/www/maintenance.flag to start maintenance and delete it to finish. The always parameter makes Nginx add the headers to error responses.

Apache

apache
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/maintenance.flag -f
RewriteCond %{REQUEST_URI} !^/robots\.txt$
RewriteCond %{REQUEST_URI} !^/maintenance\.html$
RewriteRule ^ - [R=503,L]
ErrorDocument 503 /maintenance.html
Header always set Retry-After "3600" "expr=%{REQUEST_STATUS} == 503"

WordPress

WordPress core's own maintenance mode, used during updates, already does this correctly: while the .maintenance file exists it sends a 503 with Retry-After: 600. Third-party "coming soon" and maintenance plugins vary, so check each one's status code with curl before relying on it. Our WordPress AI search readiness guide lists other settings worth checking.

CDNs and hosting platforms

Most CDNs and platforms let you return a custom status from an edge rule or function. Whatever tool you use, confirm three things: the status is 503 rather than 200, /robots.txt is excluded, and the edge does not cache the 503 response.

How to test your maintenance mode before you need it

Turn maintenance on in staging, or on production for a minute at a quiet time, and run:

bash
curl -sI https://www.example.com/pricing | grep -iE "^HTTP|retry-after|cache-control"
curl -sI https://www.example.com/robots.txt | grep -iE "^HTTP|content-type"

You want 503 and a Retry-After header on the page, and 200 with text/plain on robots.txt. Then check with a crawler user agent, because bot rules sometimes take a different path:

bash
curl -sI -A "GPTBot/1.1" https://www.example.com/pricing | head -1

After maintenance ends, repeat the checks to confirm pages return 200 again and that no CDN is still serving the cached maintenance page. If the outage ran longer than planned, Search Console's crawl stats report and your server logs will show when crawlers returned.

Frequently asked questions

Is a 503 bad for SEO?

A short 503 is the documented way to signal temporary unavailability. Google slows crawling and resumes when pages return 200. Long or repeated 503s are the problem, because Google eventually drops URLs that keep failing.

Do crawlers obey Retry-After?

Google recommends sending it but does not commit to a specific retry time. Treat it as a hint. The important part is the 503 status itself.

Should I use 503 for a planned migration that takes a weekend?

Only if the site truly cannot serve pages. Google suggests a few days at most. If you can keep the old site running read-only during the migration, that is safer.

Can I show a maintenance message on only some pages?

Yes. Return 503 only on the URLs that are affected, such as checkout during a payment provider change, and leave the rest of the site at 200.

Check your error handling

Maintenance mode is one of several places where a wrong status code quietly changes what crawlers store. Run the free check on a key page to see the status and content crawlers receive, or ask for an audit that checks status codes, robots.txt and error handling across the site.

Filed under Access and robots.txt. Topics: http-status, robots-txt, google, troubleshooting