Should deleted documents return 404 or 410, how to choose between the two status codes?
After the content is deleted, should the page return 404 or 410? Choose according to the definition: 404 means the server cannot find the requested resource, and it only indicates that the resource is missing without distinguishing whether it is temporary or permanent; when the resource is permanently removed, the server should change to send 410. So this is not a question of 'which is better', but whether you can confirm that it is permanently removed now. If you can confirm, send 410; if not, or if there is alternative content, go with 404 or 301.
What do the two status codes mean?
The fact expressed by 404 is thin: The address currently has no corresponding resource. It does not promise that it will not have one in the future, so the crawler will still visit at its own pace, and readers and callers cannot judge whether the content has been removed or temporarily failed.
410 expresses a clear judgment: The resource has been permanently removed, and there is no known redirect address. Its semantic strength is higher, as if the site has made a conclusion for the crawler, saving the cost of repeated visits. The cost of making a judgment is in your hands - once issued, the cost of withdrawal is higher than 404.
| Status code | What does it mean | The judgment is borne by the site | Applicable time |
|---|---|---|---|
| 404 | Resource not found | Do not judge whether it is permanent | Status uncertain, may recover |
| 410 | Permanently removed | Confirmed permanent and no alternative address | Content is determined not to recover |
| 301 | Address has been migrated | Provide a new official address | Has an inherited content |
| Server error code | Service temporarily abnormal | Does not represent the content status | Program or dependency failure |
How to differentiate between permanent removal and temporarily not found
The boundary lies between 'whether it is recoverable' and 'whether there is alternative content.' The deletion action in the content management system is often not a physical deletion, and the recoverability directly determines that the status code should be conservative. AnQiCMS divides the document status into formal documents, drafts, pending publication, and recycling bin. Deleting a formal document is moving it to the recycling bin rather than a physical deletion, and deleted documents can be restored from the recycling bin. Under this process, the address just deleted should maintain 404: the content may be restored at any time, and sending a 410 is making a promise to the outside world that you may overturn at any time.
The truly suitable 410 is another category: channel offline, event page archiving, content determined not to be listed due to compliance requirements, and confirmed not to be migrated. Such decisions are usually accompanied by a batch cleanup, and the status code is processed in batches rather than individually based on a feeling.
Why deletion does not equal immediate 410
In addition to recoverability, there are two reasons why 'immediate 410' is not cost-effective.
The first is the judgment window. Deletion is often initiated by the business, whether to recover, whether to merge into a new page, it takes some time to determine. In this window, 404 is sufficient.
The second is the way of inheriting historical addresses. Many deletions actually accompany content rewriting: old articles are replaced by more complete versions. In this case, the correct action is not to return an error code, but to use 301 to direct the old address to the new address, AnQiCMS supports 301 redirect management to set URL redirection, and transfer the access along with the existing signals.
On the contrary, directly changing a large number of addresses that could have been redirected to 410 is equivalent to actively discarding the inheritance relationship of these addresses, and readers coming from external links will only see a result of '永久没有'.
The order of taking over old addresses
It is recommended to fix the practical operation sequence to avoid making temporary decisions each time.
First, decide the destination of the content: if there is alternative content, go with 301; if the content is no longer available, proceed to the second step.
In the second step, check the recoverability: if it is still in the recycle bin or the address may be restored, keep it as 404. At the same time, do not leave the address on the sitemap list, AnQiCMS will automatically generate the sitemap, and the formal visible address and the deleted address should be distinguishable.
Step 3 discusses 410: confirm permanent removal, no alternative, beyond recovery period, then batch change to 410, and leave the judgment basis for this batch of addresses in the site maintenance records.
Final step: clean up links pointing to these addresses within the site, including navigation, in-line links, and list items, otherwise visitors will still enter the wrong page.
Common questions
Will 410 make links faster to be removed?Semantically, it gives a clear and permanent conclusion, reducing unnecessary visits; but the premise is that your judgment really does not change.
Can the same batch of addresses be 404 first and then changed to 410?Can, this is also a more stable order: first observe the possibility of recovery and substitution, and then unify the change.
What will be returned for drafts and content to be published?They should not appear on public addresses. Internal drafts can be accessed through preview parameters, and when external requests are made to these addresses, no indexable content should be provided.
What should be paid attention to in the error page experience?Provide the in-site search entrance and column links, keeping the readers within the site, which is more effective in reducing attrition than simply displaying status codes.