Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I am wondering about the standard handling of deleted data links from an application and an SEO perspective.

I have an application where users can create content but they can also delete content. What is the best way to handle incoming traffic to links that have since been deleted?

Should I redirect them somewhere with a 301 or should I throw a different error and just leave the page in tact with an error message?

share|improve this question

migrated from stackoverflow.com Aug 5 '12 at 13:29

This question came from our site for professional and enthusiast programmers.

    
I've flagged this for migration –  John Conde Aug 5 '12 at 0:59

2 Answers 2

up vote 6 down vote accepted

If the page is not replaced by new content Send a 410 GONE HTTP status message which tells search engines that the page doesn't exist anymore. Have the page's content tell the user why the page is gone and give them options for finding existing content on your website. This should links to your home page, site map (if one exists), search page (if one exists), and links to similar content (if such content exists).

share|improve this answer
1  
I want to warn you not to mark as fixed any 404 error in Google Webmaster Tools for a page that does not exist. You are telling Google that the page does exist and that you fixed the problem and Google should try again. If you simply leave it, in time it will disappear. Google will retry 404 errors several times before giving up. –  closetnoc Nov 17 at 2:57

John Conde's suggestion of returning an HTTP 410 Gone status code is good, but, depending on the circumstances, a plain old HTTP 404 Not Found might be more appropriate.

Specifically, the HTTP 410 status code is intended to signal that the resource has been deliberately and permanently deleted, is not expected to return, and that links to it should be removed. Search engines may treat it as a signal to delist the content, and not to relist it even if new links to it are found. Thus, if it's possible that a user may have deleted a page by mistake, or with the intent of replacing it with new content, a plain old 404 response may be safer.

In particular, this is what the HTTP/1.1 standard says:

10.4.5 404 Not Found

The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent. The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable and has no forwarding address. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.

10.4.11 410 Gone

The requested resource is no longer available at the server and no forwarding address is known. This condition is expected to be considered permanent. Clients with link editing capabilities SHOULD delete references to the Request-URI after user approval. If the server does not know, or has no facility to determine, whether or not the condition is permanent, the status code 404 (Not Found) SHOULD be used instead. This response is cacheable unless indicated otherwise.

The 410 response 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. Such an event is common for limited-time, promotional services and for resources belonging to individuals no longer working at the server's site. 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.

In any case, 404 is the more generic status code; if you're in doubt about whether to use 404 or 410, using 404 is never wrong.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.