410 Gone: what it means, 404 vs 410 for SEO, and when to use it

, Founder · Updated

A 410 Gone status means the page was removed on purpose and is not coming back. It is a more specific version of 404 Not Found: a 404 says nothing is at the URL, a 410 says something used to be there and the removal is likely permanent. Use it for content you deleted deliberately with no replacement, such as an expired promotion, a discontinued product or spam pages left by a hack.

The HTTP specification defines it this way: "The 410 (Gone) status code indicates that access to the target resource is no longer available at the origin server and that this condition is likely to be permanent." It also says when not to use it: "If the origin server does not know, or has no facility to determine, whether or not the condition is permanent, the status code 404 (Not Found) ought to be used instead" (RFC 9110, section 15.5.11).

404 vs 410

404 Not Found410 Gone
What it saysNothing is at this URL; maybe temporary, maybe notThe resource was here and is gone, likely for good
When to use itThe default for any missing URLContent you removed on purpose, with no replacement
RFC 9110 guidance"does not indicate whether this lack of representation is temporary or permanent"Preferred over 404 "if the origin server knows" the condition is likely permanent
How Google Search treats itNot indexed; removed if indexed; crawled less oftenThe same as 404

RFC 9110 explains what 410 is for: it "is primarily intended to assist the task of web maintenance by notifying the recipient that the resource is intentionally unavailable and that the server owners desire that remote links to that resource be removed." It names "limited-time, promotional services" and "resources belonging to individuals no longer associated with the origin server's site" as typical cases.

The specification also says you don't have to use it: "It is not necessary to mark all permanently unavailable resources as 'gone' or to keep the mark for any length of time -- that is left to the discretion of the server owner."

410 and Google Search

Google's documentation doesn't give 410 special handling. It lists 400, 401, 403, 404, 410 and 411 together and states that "all 4xx errors, except 429, are treated the same". For those codes, "Google doesn't index URLs that return a 4xx status code", "URLs that are already indexed and return a 4xx status code are removed from the index", and "the crawling frequency gradually decreases" (Google Search Central).

So choose between 404 and 410 for accuracy, not for a ranking effect. If you can easily tell deliberately removed pages apart from mistyped URLs, 410 records that difference for crawlers, people who maintain links to you, and your own team reading the logs.

Removing pages you never wanted indexed

A 410 is useful after a hack that created thousands of spam URLs, or for old tag and filter pages you have pruned. Google's Removals tool help says the tool alone only hides a URL temporarily ("about six months"); to remove it permanently, "make sure that your web server returns either a 404 (Not Found) or 410 (Gone) HTTP status code", block access, or add noindex (Removals tool help).

When to use 410, 404 or a redirect

SituationBest response
The page moved to a new URL301 redirect (301 vs 302)
A close replacement exists (a newer model, a merged article)301 redirect to the replacement
Removed on purpose, nothing replaces it410 Gone
Spam or hacked URLs you want out of the index410 Gone
You don't know if it is permanent, or the URL never existed404 Not Found
Out of stock but coming backKeep the page live with 200 and say so

How to return 410, by platform

nginx

The return directive "stops processing and returns the specified code to a client" (nginx rewrite module):

location = /spring-sale-2024/ {
    return 410;
}

location ^~ /old-catalog/ {
    return 410;
}

Apache

mod_alias supports a gone status: it "returns a 'Gone' status (410) indicating that the resource has been permanently removed. When this status is used the URL argument should be omitted" (Apache mod_alias):

Redirect gone "/spring-sale-2024/"

Cloudflare

Cloudflare states that it "does not generate 410 for customer websites, we only proxy the request from the origin server" (Cloudflare error 410). Configure the 410 on your origin, or in your application's routing.

Applications and CMSs

In an application framework, return the status from the route handler for removed records. For example, keep a list of deleted slugs and respond with 410 when one is requested, instead of falling through to the generic 404 handler. Whatever the platform, check the result from outside:

curl -s -o /dev/null -w "%{http_code}\n" https://example.com/spring-sale-2024/

Checklist before you switch pages to 410

  1. Check for links and traffic. If the page still gets visits or has links from other sites, a 301 to a relevant page keeps that value. A 410 throws it away.
  2. Remove the URLs from your sitemap. Every URL in a sitemap should return 200; confirm with the sitemap checker.
  3. Update internal links so your own pages don't point at removed content.
  4. Make sure old redirects don't end in a 410 by testing them with the redirect checker.
  5. Watch Search Console. The Page indexing report lists the removed URLs as Google recrawls them and drops them from the index.

For every status code and how Google handles it, see HTTP status codes.

Questions

Is 410 better than 404 for SEO?
Google's documentation treats all 4xx codes except 429 the same way: the content isn't used, indexed URLs are removed, and the URL is crawled less often. 410 states your intent more precisely, but you shouldn't expect Google to treat it differently from 404.
When should I use 410 instead of 404?
When you removed the content on purpose, it won't come back, and nothing replaces it. Examples are expired promotions, discontinued products with no successor, and spam pages created on a hacked site. If a page moved or has a close replacement, use a 301 redirect instead.
How long should I keep returning 410?
As long as you like. RFC 9110 says it is not necessary to keep the mark for any length of time; that is left to the server owner. Many sites keep it indefinitely because it costs nothing and keeps the intent clear.
Can I use 410 to remove hacked spam pages from Google?
Yes. Google's Removals tool help says that to remove a URL permanently, the server should return a 404 or 410 status code, block access, or add noindex. The Removals tool on its own only hides a URL for about six months.
Does Cloudflare send 410 errors?
No. Cloudflare says it does not generate 410 for customer websites and only proxies the response from the origin server. A 410 on a Cloudflare site comes from your own server or application.

Related

See where you stand in Google and AI answers

Starter is $19 a month for one site, with a 14-day free trial and no card to start.