410 Gone
Client Error - Resource permanently removed
HTTP 410 Gone
What It Means
The HTTP 410 Gone status code indicates that the target resource is no longer available at the server and no forwarding address is known. This is expected to be permanent — the resource is intentionally gone.
410 vs 404
- 404: "I don't know if this ever existed" — Resource not found
- 410: "This existed but was intentionally removed" — Permanently gone
When to Use 410
- Deleted user accounts: Account permanently removed
- Removed products: Product discontinued, not just out of stock
- Deprecated API endpoints: Old API version shut down
- Removed content: Blog post or page intentionally deleted
- Expired content: Time-limited promotion ended
Example Response
HTTP/1.1 410 Gone
Content-Type: application/json
{
"error": "Gone",
"message": "This resource has been permanently removed",
"deleted_at": "2025-01-01T00:00:00Z"
}
SEO Implications
410 is a stronger signal than 404 for search engines:
- Google removes 410 pages from index faster than 404s
- 410 tells crawlers to stop trying this URL
- Use 410 when you want quick de-indexing
Implementation
Express.js
// Soft-deleted resources
app.get('/api/users/:id', async (req, res) => {
const user = await User.findById(req.params.id);
if (!user) {
return res.status(404).json({ error: 'Not Found' });
}
if (user.deletedAt) {
return res.status(410).json({
error: 'Gone',
message: 'This user account was deleted'
});
}
res.json(user);
});
Nginx redirect to 410
# Mark specific URLs as gone
location = /old-product {
return 410;
}
# Mark entire directory as gone
location /deprecated-section/ {
return 410;
}
Decision Matrix
| Scenario | Status Code |
|---|---|
| Page never existed | 404 |
| Page moved to new URL | 301 |
| Page intentionally deleted | 410 |
| Product discontinued | 410 |
Best Practices
- Consider 301 redirect if there's a replacement resource
- Use 410 for intentional, permanent deletions
- Include a helpful message explaining the removal
- Log 410 responses to track deleted resources