410 vs 404 for deleted pages: which status code to use
Should a deleted page return 404 or 410? What Google documents, when a 301 redirect is the better answer, and how to clean up sitemaps and internal links.
By Crawlito · Updated 7 min read
In short
- Google says all 4xx status codes except 429 are treated the same, so 404 and 410 both drop a URL from the index and gradually reduce how often it is crawled.
- RFC 9110 defines 410 Gone for removals that are likely permanent and says 404 should be used when the server does not know whether the condition is permanent.
- A 301 redirect is the right answer only when a page has a real replacement covering the same thing; a page that is simply gone should return 404 or 410.
- A missing page that returns 200 with an error message is a soft 404, which Google reports in Search Console and which other crawlers may treat as real content.
- After deleting pages, remove them from XML sitemaps and internal links so crawlers stop being sent to dead URLs.
On this page
For a deleted page with no replacement, return either 404 or 410: Google treats them the same. Its documentation on HTTP status codes says all 4xx errors except 429 are handled alike, removed from the index and crawled less often over time. Use 410 if you want to state that the removal is permanent, use 404 if you are not sure, and use a 301 redirect only when another page genuinely replaces the one you removed.
The status code is the smaller part of the job. The bigger risks are soft 404s, redirects to irrelevant pages, and sitemaps and links that keep sending crawlers to URLs that no longer exist.
What 404 and 410 mean in the HTTP standard
Both codes are defined in RFC 9110, the HTTP semantics standard:
- 404 Not Found means the server did not find a current representation of the resource, or is not willing to say that one exists. It says nothing about whether the absence is temporary or permanent.
- 410 Gone means access to the resource is no longer available and this is likely to be permanent. The RFC adds that if the server does not know, or cannot determine, whether the condition is permanent, it ought to use 404 instead.
So the standard draws a real distinction: 410 is a statement of intent, 404 is a neutral "not here". Both responses are heuristically cacheable under RFC 9110, which means a cache may store them without explicit freshness headers.
How Google treats 404 and 410
Google's documentation is direct on this point:
| What Google says | Applies to |
|---|---|
| Content from the URL is not used | All 4xx except 429 |
| Previously indexed URLs are removed from the index | All 4xx except 429 |
| Crawl frequency for the URL gradually decreases | 404 and 410 |
| No effect on crawl rate for the site | All 4xx except 429 |
| Treated as a server-overload signal and slows crawling | 429 |
The key line is that all 4xx errors, except 429, are treated the same. Google does not document any speed difference between 404 and 410 for removal. Older advice that 410 drops pages "much faster" is not supported by Google's current documentation, so do not choose 410 expecting a measurable difference in Google.
Google also warns against using 401 or 403 to limit crawling. Those are for authentication and permission, not for deleted content.
For AI crawlers the picture is less documented. OpenAI, Anthropic and Perplexity do not publish how their crawlers treat 404 versus 410. A 4xx of either kind tells any client there is no content to use, which is what matters for keeping a dead page out of answers. See status codes and redirects for AI crawlers for how the other codes fit in.
When to use 404, 410 or a 301 redirect
The decision depends on whether something replaces the page, not on which 4xx code sounds stronger.
| Situation | Response | Why |
|---|---|---|
| Product discontinued, no equivalent | 404 or 410 | Nothing replaces it |
| Product replaced by a newer model | 301 to the new product | Same intent, new URL |
| Article merged into a longer guide | 301 to the guide | The content lives on there |
| Old campaign landing page | 404 or 410 | Nothing current covers it |
| Page moved to a new URL | 301 to the new URL | Same content, new address |
| Page removed for legal reasons | 410, or 404 if you prefer not to signal intent | Permanent removal |
| Page temporarily unavailable | 503 with Retry-After | It is coming back |
| Job posting that has closed | 404 or 410, or keep it with an expired notice and remove its structured data | Depends on your site's policy |
Do not redirect everything to the homepage
Redirecting every deleted URL to the homepage or a broad category page is a common shortcut, and it creates confusing signals. A visitor or crawler that asked for a specific product lands on a page that does not answer the request. Google's site move guide says not to redirect many old URLs to one irrelevant destination, such as the home page, because it can confuse users and might be treated as a soft 404. See redirecting 404s to the homepage for more. An honest 404 is clearer than a redirect to a page that is not a replacement.
A good test: if a person who had bookmarked the old URL would be happy to land on the target, redirect. If they would be confused, return 404 or 410.
Keep redirects as long as they are used
Google's redirects documentation says to use permanent redirects when you are sure the redirect won't be reverted. There is no expiry date in the HTTP standard. Keep a 301 in place while it still receives traffic or links, and check your logs before removing old redirect rules.
Soft 404s: the most common mistake
A soft 404 is a page that tells people "not found" but returns 200 OK. It happens when a CMS or a single-page app catches unknown URLs and renders an error template without setting the status code.
curl -s -o /dev/null -w "%{http_code}\n" https://www.example.com/products/discontinued-itemIf this prints 200 for a page you deleted, you have a soft 404. Google says that when a 2xx page appears to be an error page, Search Console shows a soft 404 error in the Page indexing report. Crawlers that do not run that kind of detection see a successful response with thin "not found" text, which they may store as the content of the page.
Single-page apps are the usual source. The server returns the app shell with 200 for every path, and the router shows a "not found" view in the browser. SPA 404 status codes and client routing covers fixes for React, Vue and similar frameworks, and soft 404 pages covers diagnosis on any stack.
How to return 410 on common servers
Most platforms return 404 for deleted pages automatically. If you want 410 for specific URLs:
location = /old-campaign/ {
return 410;
}
location ^~ /discontinued/ {
return 410;
}# .htaccess with mod_alias
Redirect gone /old-campaign/
RedirectMatch gone ^/discontinued/Keep a helpful body on the error page: a short message, a search box and links to main sections. The status code tells crawlers there is no content; the body helps the people who arrive anyway.
Check the result:
curl -sI https://www.example.com/old-campaign/ | head -1You should see HTTP/1.1 410 Gone or HTTP/2 410.
Clean up sitemaps and internal links
Returning the right status code does not stop your own site sending crawlers to dead URLs. After a batch of deletions:
- Remove the URLs from your XML sitemaps. A sitemap is a list of URLs you want crawled. Listing deleted pages wastes crawler requests and can make the sitemap look unreliable. See XML sitemaps for AI discovery.
- Fix internal links. Search templates, menus, footers and body content for links to the removed URLs. Point them to the replacement, or remove them. Internal links and broken links has a crawl-based method.
- Update canonical tags and hreflang that reference removed pages, so no live page points to a dead one.
- Check feeds and structured data. RSS feeds, product feeds and
ItemListmarkup often keep old URLs after the page itself is gone. - Leave robots.txt alone. Do not disallow deleted URLs. A crawler that cannot fetch a URL cannot see that it returns 404 or 410, and Google's documentation says a URL blocked by robots.txt can still be indexed without its content if it is linked from elsewhere.
Removing a page from Google faster
For urgent cases, Search Console's Removals tool hides a URL from Google results while the 404 or 410 takes effect. Google's guide to removing information says those requests last about six months, so the status code or a noindex is still what makes the removal permanent.
Frequently asked questions
Is 410 better than 404 for SEO?
Not in Google. Google says all 4xx codes except 429 are treated the same. Use 410 if you want to signal a permanent removal, but do not expect a measurable difference in how fast Google drops the page.
Will lots of 404 errors hurt my site?
Google says 4xx codes other than 429 have no effect on the crawl rate for the site. Pages that should not exist returning 404 is normal. The problem is broken internal links that send visitors and crawlers to them.
Should I redirect deleted pages to the homepage?
Only redirect when there is a page that genuinely replaces the deleted one. A blanket redirect to the homepage does not answer the request, and Search Console may flag such pages as soft 404s.
How long should a 301 redirect stay in place?
There is no fixed limit in the HTTP standard. Keep it while the old URL still gets traffic or links, and check your logs before removing it.
Do AI crawlers handle 404 and 410 differently?
OpenAI, Anthropic and Perplexity do not document a difference. Both codes tell any client there is no content at the URL.
Check what your deleted pages return
Status code problems hide well because the page looks fine in a browser. Run curl -I on a sample of removed URLs and look for 200s that should be 404s. To see the status code, headers and readable content for one page as AI crawlers receive it, run the free check.
Filed under Access and robots.txt. Topics: http-status, google, sitemaps, internal-links, troubleshooting