Http 410 status code
If you are here, you have just encountered a error code 410.
Http 410 response code definition
The Http Status 410 Gone (HTTP = HyperText Transfer Protocol) is one of the client status codes (the 4xx series) indicating that access to the requested page or resource is no longer available on the server, a priori permanently, and no redirection address for that page or resource is known.
This is different from the Http 404 Not found status, which means that no page or resource can be found at the requested address, but the server says it’s not final.
Difference between Http 404 and Http 410 status for SEO
When Google crawls your website to index your pages, it will treat each page or resource differently depending on the Http code returned by the server.
In the case of Http 404 Not found response, the server tells the robot that there is a temporary problem. It will there come back within 24 hours to recrawl that page and do an action. If the page is still in 404, it may decide to remove it from its index, with the aim of not directing a user to a page that doesn’t work.
In the case of a Error 410 Gone, the server tells the robot that the page is definitely gone. Knowing this information, the robot doesn’t have to wait to make the decision to delete the page from its index so that it is no longer presented to Google users.
The robot will come back later to check that this page has disappeared and that the server had not returned a wrong code.
It is always important to be concerned about all status codes returned by your server as they can have a negative impact on Google’s crawl of your site.
Find out what Google says about 410 status: https://www.searchenginejournal.com/google-404-status/254429/
How to handle 410 errors on your website
As 410 status code can penalize your website’s crawl, it is important to monitor them.
Customize a Http 410 status page
Finding a web page in error when visiting a website is frustrating for the visitor.
It is therefore important to customize error pages to explain to the visitor why there is this error and what to do.
How to do it in 3 steps on an Apache server
- Edit your site’s .htaccess file if you’re on an Apache server by adding the code pointing to the page to present to the user corresponding to http 410
ErrorDocument 410 <local-path>/error-410.html
2. Create the page error-410.html. Put yourself in the visitor’s shoes. He is disappointed that he cannot find what he is looking for. What should you tell him? A humorous page can lighten the mood. Explaining the problem and pointing them to an alternative solution will keep them browsing.
3. Test your new page to make sure everything works and the message is relevant.
And on NGINX?
The steps are the same but for the first one, NGINX doesn’t have an .htaccess file, so you have to modify the configuration file which is in the etc/nginx/sites-enabled directory.
You will use the default server block file if you have not created a specific file for the configuration, otherwise your specific file. Add
server {
...
error_page 410 /custom_410.html;
location = /custom_410.html {
root /usr/share/nginx/html;
internal;
}
...
}
Understanding the HTTP 410 Status Code
The HTTP 410 status code, also known as “Gone,” indicates that a resource has been permanently removed from a server. Unlike the 404 status code, which suggests that a resource might return, the 410 status is a definitive signal that the resource is no longer available and won’t come back.
What Triggers a 410 Error?
- Removed Content: A webpage permanently deleted without a replacement.
- Expired Promotions: Landing pages for time-limited offers or events.
- Discontinued Products: Pages for items no longer sold or supported.
410 vs. 404: What’s the Difference?
410 Status Code | 404 Status Code |
---|---|
Permanent removal of a resource. | Resource might return in the future. |
Faster de-indexing by search engines. | Search engines may continue crawling. |
How to Implement a 410 Status Code
1. Apache
RewriteRule ^outdated-page$ - [L,R=410]
2. Nginx
server { location /outdated-page { return 410; } }
3. WordPress
Use a plugin like Redirection or add the following to your functions.php
file:
function set_410_status() { if (is_page('outdated-page')) { header("HTTP/1.1 410 Gone"); exit(); } } add_action('template_redirect', 'set_410_status');
SEO Considerations
Using a 410 status code can help maintain a clean URL structure and improve crawl efficiency. However, it should only be used when:
- The content is irrelevant or outdated.
- You want search engines to stop indexing the page quickly.
For pages with valuable backlinks or potential traffic, consider a 301 redirect instead to preserve SEO equity.
Example Request-Response Cycle
Request: GET /outdated-product HTTP/1.1 Host: example.com Response: HTTP/1.1 410 Gone Content-Type: text/plain
Troubleshooting 410 Errors
- Check server logs to identify pages returning 410 errors.
- Deactivate plugins or extensions that may affect URL behavior.
- Restore backups if a 410 error occurs due to accidental changes.
Read also: understanding the Youtube 503 status code.