Core methods
Returning 410 (or 404) for an Entire Website: Setup and Pitfalls
When a site is genuinely finished, the most honest signal is the one the protocol already provides: this content is gone. Implementing it for every URL is simple, but a few details decide whether Google believes you.
What Google does with 4xx
According to Google's HTTP status code documentation, all 4xx errors except 429 are treated the same, and 404 and 410 are listed without separate handling. Google does not use content from URLs that return a 4xx. Newly encountered 404 pages are not processed, crawl frequency for them gradually decreases, and if a URL was previously indexed, the indexing pipeline removes it. The page gives no specific timeframe.
So the practical choice between 404 and 410 is about accuracy and other consumers, not Google speed. 410 means "gone, deliberately". 404 means "not found". For a closed site, 410 communicates intent better.
Implementation
Apply the status at the lowest layer that covers everything: edge rule, web server or load balancer.
| Platform | Approach |
|---|---|
| NGINX | location / { return 410; } in the server block |
| Apache | RedirectMatch gone .* in the vhost, or a rewrite rule with the [G] flag |
| CDN or edge function | A rule returning status 410 with a short body |
| Static host | Replace the content with a single error page and use the host's catch-all rules to return the 410 status |
Keep the body tiny and honest, such as "This site has been closed." It should not contain the old content or navigation to it.
The soft 404 trap
Google's documentation says a soft 404 applies to 2xx responses whose content suggests an error, such as an empty page or an error message, and Search Console will report it as a soft 404. If you replace your site with a friendly closure page but serve it with a 200 status, Google may treat it as a soft 404, and the status is not a clean removal signal. Always verify the real status, not the visible text. With curl, curl -sI https://example.com/any-path should show 410 or 404 on the first line.
Equally risky: catch-all redirects. Sending every old URL to a single page, particularly the homepage, can also be treated as a soft 404 when the destination is not equivalent content.
Keep these working
Some URLs should not return 410.
robots.txtshould return 200 and allow crawling, so Google can fetch the 410s. A robots.txt that returns an error can change how Google handles the whole host.- Search Console verification files or records if you use them. DNS verification is not affected by HTTP.
- Any ACME or certificate validation path your host needs.
- Mail and API endpoints on different hostnames.
Handling all hostnames and protocols
Apply the same rule to www and non-www, http and https, and every alias. For the HTTP version, it is fine to redirect to HTTPS first and return 410 there, but avoid chains. See alternate hostnames.
Pairing with temporary removals
Because Google's reprocessing depends on recrawl, add a prefix removal in Search Console for faster hiding. Search Console Help warns that if a removed URL becomes unreachable with errors such as 404 or 502/503 the block can expire, which means the tool is a bridge, not the fix. Your 410s are the durable part.
What to monitor
- Pages report: URLs should move into "Not found (404)". A 410 is reported in the not-found group.
- Logs: confirm Googlebot is receiving 410/404 responses for old paths.
- site: queries trending down over weeks.
- Unexpected 200s: a plugin, a cache or a CDN rule may serve stale pages.
Caching gotchas
CDNs and reverse proxies can keep serving an old 200 from cache after you change the origin. Purge the cache after switching to 410, and check responses from several regions if your CDN is global. Also confirm the 410 is not cached for a path you later restore.
When the site comes back
If you reuse the domain, 410 responses are not permanent in any binding sense, but Google may take time to recrawl and reindex pages once they return. Plan for a slow recovery, and read deindexed by mistake.
Checklist
- Status confirmed as 410 or 404 on home, deep URLs, random paths and files
- Same on www/non-www and http/https
- robots.txt returns 200 and does not disallow
- No catch-all redirect to the homepage
- Cache purged
- Prefix removals filed
- Reports checked weekly
Example: closing a campaign site
A campaign microsite ended and its owner wanted it gone. The team put an edge rule on the hostname that returned 410 with a one-line body for every path except robots.txt, which returned 200 with an empty disallow. They purged the CDN, tested a homepage, a deep URL, an image and a random path, filed a prefix removal and left the DNS verification record in place. Over the following weeks the Pages report moved URLs into not found, and a final check at month six found nothing indexed.
A five-URL test you can run today
- The homepage.
- A deep page you know existed.
- A path that never existed.
- An image or PDF.
/robots.txt.
The first four should return 410 or 404. The last should return 200.
Frequently asked questions
Is 410 faster than 404?
Google's documentation treats them the same, so do not expect a difference.
Can I return 410 and keep users informed?
Yes, with a short plain message in the response body, as long as the status code stays 410.
Does 410 stop Googlebot immediately?
No. Crawl frequency decreases gradually for such URLs.
Should robots.txt also return 410?
No. Keep it returning 200 and permissive during the removal.
Official sources
Keep reading
- Pillar: How to Deindex a Website From Google and Bing: The Complete Guide
- Noindex vs Password Protection vs 410: Which Method Should You Use?
- How to Retire an Old Domain Without Leaving Ghost Results in Google
- Removing a Directory or Section of a Site From Google
- How to Confirm a Site Is Deindexed: site: Checks and Other Evidence