Serve a 503 During PHP Patch Windows and Keep robots.txt Live
Google’s reminder to return a 503 during PHP patches protects indexed URLs, but the robots.txt file must stay reachable. Here’s how to implement it safely.
Google Search Central has reminded site owners that when you take PHP‑driven sites offline for emergency patches, you should serve an HTTP 503 (Service Unavailable) response instead of a generic 404 or a 200 error page. The 503 tells Google the outage is temporary and preserves already indexed URLs.
At the same time, Google’s guidance stresses that the robots.txt file must continue to return a normal response. If robots.txt itself returns a 503, Googlebot is blocked from crawling the entire domain, which can lead to loss of visibility.
Why the 503 matters for SEO
A 503 signals to Googlebot that the problem is short‑lived. Google’s crawl‑rate documentation says it will temporarily reduce crawling for URLs that return 500‑series codes, then resume normal rates once the site returns 200 responses. This helps keep the URLs in the index while you work on the fix.
Google also notes that URLs returning a 503 are “preserved in the index, but eventually dropped” if the error persists beyond the recommended one‑to‑two‑day window. The guidance therefore treats the 503 as a short‑term safety net, not a permanent state.
Common pitfalls to avoid
- Don’t let PHP generate the 503; the code itself is down during the patch.
- Avoid returning a 200 page that simply says “Site down”. Google would index that content.
- Never serve a 503 for robots.txt – it blocks all crawling.
- Don’t rely on generic 404 or 500 responses, which can cause Google to treat the error as permanent.
How to implement a 503 without PHP
Because PHP is unavailable during the patch, the 503 must come from a layer that remains operational. Google’s John Mueller suggested using a CDN rule, an edge server, or a DNS‑level redirect that can return the status code independently of the application stack.
The steps are:
- Create a rule in your CDN or edge platform that matches all site URLs and returns a 503 response.
- Attach a Retry‑After header to the response. The header can be a number of seconds or a UTC date‑time, letting Google know when to try again.
- Ensure the rule does not affect the robots.txt path, keeping that file served from a server that stays up.
Monitoring and rollback
Google’s crawl‑rate system will automatically increase crawling once the error count drops, and the indexed URLs will reappear in search results without manual intervention.
What to do now
Audit your current hosting setup to identify a fallback that can serve a 503 without relying on PHP. Implement a rule in your CDN or DNS provider that returns the 503 and a Retry‑After header during scheduled patches, and verify that robots.txt remains reachable. Test the flow on a staging domain, then schedule your next PHP update with the new configuration in place.
The services behind this post.
Frequently asked questions.
Google says indexed URLs that return a 503 are preserved, but if the same URLs return a 503 for more than one‑to‑two days they may eventually be dropped. Keep the 503 short‑lived and restore 200 responses promptly.
Talk to the team that does this every day.
Tell us what you're trying to grow. You'll get a plan, not a pitch.
Contact Us