Partial fix Likes links will not be deleted from deleted user

DRaver

Active member
If a user is deleted, his profile will be also deleted.
But likes from him stay in the posts with a link to a profile that does not exist.
You and Google get a 404 error.
That is bad for seo and also wrong from the code.

The 404 (Not Found) say: The requested resource could not be found but may be available again in the future. Subsequent requests by the client are permissible.

The 410 (Gone) say: Indicates that the resource requested is no longer available and will not be available again. This should be used when a resource has been intentionally removed and the resource should be purged.

I should prefer that the profile retained when delete, as well as all other data from the user.
But if that is not possible, a 410 code should be sent and not a 404.
 
That is bad for seo and also wrong from the code.
On the SEO part, no. It isn't bad for SEO. And Google treats 404 and 410 errors the same:

https://support.google.com/webmasters/answer/2409439?hl=en

404 errors are not bad for SEO:
Generally, 404 errors don’t impact your site’s ranking in Google, and you can safely ignore them

Google treats 404 and 410 the same and just expects you to return either:
When you permanently remove content without intending to replace it with newer, related content, let the old URL return a 404 or 410. Currently Google treats 410s (Gone) the same as 404s (Not found).

In the context of member profiles, when a user is deleted, they are no longer found in the database hence they are treated the same as if they never existed. The 404 is used as a catch all solution and is perfectly valid.
 
No, a 404 error is ugly and bad. You can get thousands of error messages displayed in Google Webmaster Tools. A 410 is the right way.

Anyway. What is the sense of thousands links to documents that do not exist?
 
Well, according to Google:
Generally, 404 errors don’t impact your site’s ranking in Google, and you can safely ignore them

Google treats 410 and 404 the same, so a change here wouldn't impact anything.

That would be a suggestion, rather than a bug report, though.

As for not removing likes when a user is deleted, that has been reported before and the current behaviour is As Designed, hence this is a duplicate report:

https://xenforo.com/community/threads/deleting-user-does-not-remove-likes.72727/
 
Even if google treats 410 and 404 differently, I think it's still valid to use 404 in this case.
As mentioned in the first post, 404 means 'could not be found but may be available again in the future'.
When user is deleted, his username is now free to use. Somebody else may register with his name and the profile is re-created.
 
If only one person delete day by day and every person has only 100 like links in post than you have 700 internal dead links in a week. 2800 in a month and over 30000 in a year. I have a big board with self delete. So I told you 30000 internal links to nowhere is crap and a BUG.
 
If you believe that behaviour will have a negative impact (which it won't according to Google) then you need to remove the Self Delete add-on and handle it manually or use a different add-on that can remove the likes automatically.

Since XF 1.4 there is a remove likes function in the Admin CP for each user.
 
It's worth noting, too, that it isn't just likes. If you take the following non existent user as an example. If your deleted user has been tagged hundreds of times, that will also lead to 404s.

@Non Existent User
 
Given the focus here on 404 vs 410, you would need to take your own approach to send a 410 if you wanted to. You would need to handle it for all content types as well. Otherwise, when the data is removed, there's nothing for us to know whether the content was valid in the first place. In a sense, sending a 410 vs a 404 would actually leak a difference, which may or may not be significant to you (unlikely, but it does give additional information).

In terms of the difference to Google, it's mostly regarding how it removes pages from the index; having 404 links is not inherently wrong or unexpected these days.
 
Not entirely true ...
http://searchenginewatch.com/article/2340728/Matt-Cutts-on-How-Google-Handles-404-410-Status-Codes

A 410 is technically correct and accurate, so I believe a bug report is reasonable. Albeit a low priority
Actually, that video goes on to confirm exactly what the other link on Google's site confirms. The end result of a 410 and a 404 is identical: The page is deleted from the index. The difference lies in how long it actually takes to remove it from the index.

The video is well worth watching, it makes it very clear the difference in how the two codes are handled:

To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.

My favourite line from it is:
In general sometimes webmasters get a little too caught up in tiny little details.

And so if a page is gone, it's fine to serve a 404. If you know it's gone for real it's fine to serve a 410.
 
Forget google. What is with the thousands of error messages in wmt or millions on your server logs? Please explain me @Mike : what is the sense of linking content, what does not exit? Do you think what this is a clean design of a web page? Why you don't delete the like links in posts if a user was delete? And why ist that not a bug. It is.
 
Last edited:
Google logs errors in Google Webmaster Tools to give you the opportunity to rectify mistakes that may have been made.

For example, if you accidentally deleted an entire forum node, the pages would now be serving 404s, logging errors in GWT and you would have an opportunity to solve that problem before it affects the content that is indexed on your site.

After a period of time, Google will remove those pages from the index, and those errors will no longer appear in Google Webmaster Tools.

Using a 410 would make that process happen quicker, but the end result is the same.

The link to the deleted user is likely to be removed when the content is liked by another user because that will rebuild the cache of likes on that content. It has been designed that way.

This bug report relates to the use of 404 vs 410, hence why this thread is marked "Not A Bug".
 
No, this bug is not report related only to use a 404 or 410. The bug is like links will not deleted from a deleted user. Content what doesn't exit will be linked. That makes no sense and CAN be a sign for Google, that the webmaster has no experience from his own website. Internal massive linking of content that not exit is not a bug?
 
So I did actually find a bug in that our like cache updating code was running but it wasn't firing correctly on the user delete case. That actually fixes the bug in the subject line. (That code was mostly for merges/username changes, though it works here as well.)

However, the body of the report actually seems to focus almost entirely on 404 being the wrong response code and that element is not a bug. In theory, 410 may be better but it doesn't make 404 incorrect (a 200 response would be incorrect).

Because there are 2 components in this report, it makes tagging a resolution difficult.

Additionally, generally speaking, linking in a cached element to something which may be removed later is not something that we consider as a bug. Caching is needed to improve performance and attempting to change cached content is generally very difficult and, at best, very hacky. It's simply a trade off and if the trade off doesn't fit your needs, it's a change you may need to make for yourself.
 
The video is well worth watching, it makes it very clear the difference in how the two codes are handled
"While technically they both mean 'page not found,' Matt Cutts talks about the nuances of each and how Googlebot treats each slightly differently."
 
Additionally, generally speaking, linking in a cached element to something which may be removed later is not something that we consider as a bug. Caching is needed to improve performance and attempting to change cached content is generally very difficult and, at best, very hacky.

By the way. Rebuilding of the cache dont delete the links. That mean not only the "like links". Also the "tagging links".

So if your forum ist not to small you have thousends off 404 error every day in your server logs.
A fault diagnosis is almost impossible because, if you have other problems and want to finde with the help of error logs.

So the best solution in my eyes is, don´t delete the member profiles by default, if a member was deleted.
This has several advantages.
 
Top Bottom