36

Today I exceeded 10K reputation on Stack Overflow, and I see deleted answers. I am now faced with pages like Convert HTML to PDF in .NET where half the answers are "deleted."

Among these are many non-answers deleted by diamond moderators, and a self-deleted answer deleted on Nov 25 '09. I find this very distracting, especially in my chosen sort order of "oldest" where these deleted answers are NOT displayed at the bottom.

I wish to be able to hide deleted answers based on combinations of characteristics such as:

  • age since deletion
  • deleted-by-owner
  • deleted by diamond moderators
  • zero undelete votes

This would be a setting every user could enable for himself.


Here are HTML excerpts that may be useful for userscript filtering.

This shows the code that appears for a moderator deletion, as well as the date stamp.

<div class="deleted-answer-info">deleted by <a href="/users/10936/dori">Dori</a><span class="mod-flair" title="moderator">♦</span> <span title="2011-06-26 09:13:34Z" class="relativetime">Jun 26 at 9:13</span></div>

Here is the same class for deleted by owner:

<div class="deleted-answer-info">deleted by owner <span title="2009-11-25 19:12:11Z" class="relativetime">Nov 25 '09 at 19:12</span></div>
16
  • 2
    If you hide deleted answers with zero undelete votes, how are they ever going to get one?
    – Brandon
    Commented Oct 28, 2011 at 14:38
  • @Brandon question updated to reflect my thinking. That would not be the only criterion for the filter.
    – Mr.Wizard
    Commented Oct 28, 2011 at 14:42
  • 1
    @Mr.Wizard Rather update your original question. It's almost a complete copy and paste. Commented Oct 28, 2011 at 14:43
  • @slhck this has nothing to do with deleting anything; it is a replacement for the prior question.
    – Mr.Wizard
    Commented Oct 28, 2011 at 14:43
  • @Diago, the diamond mod suggested I create a new one. I thought it best to listen.
    – Mr.Wizard
    Commented Oct 28, 2011 at 14:43
  • 1
    My apologies. I only noticed now you did this based on a moderator's recommendation. Commented Oct 28, 2011 at 14:44
  • K guys, this is about hiding deleted answers; no need to close.
    – user1228
    Commented Oct 28, 2011 at 15:02
  • So, you wish to be able to hide them for yourself or would this apply automatically to all people? Because I personally would like to see those kinds of deleted posts.
    – slhck
    Commented Oct 28, 2011 at 15:08
  • 1
    @slhck: for himself, not everyone.
    – user1228
    Commented Oct 28, 2011 at 15:12
  • You should delete the question that people are thinking this dupes, this is way better. Commented Oct 28, 2011 at 15:45
  • 2
    Would it be enough to just push deleted answers to the bottom regardless of sort order? Commented Oct 28, 2011 at 15:50
  • @MichaelMrozek - like this - Push deleted answers to the end for all sort orderings?
    – ChrisF Mod
    Commented Oct 28, 2011 at 15:57
  • 7
    Jeez, people. This is different than the OP's previous question. Or are the closers unable to understand that permanently delete != hide via user settings?
    – user1228
    Commented Oct 28, 2011 at 16:38
  • @ChrisF Oh, yes. Good find Commented Oct 28, 2011 at 18:04
  • 1
    I think more in favor of adding a check box in the settings saying "do not show deleted posts" if you'rd a 10k mod. Commented May 8, 2017 at 0:11

4 Answers 4

44

One of the things that I didn't like about reaching 10k was that my clean, neat interface was now cluttered with trash.

What happens when you're a 10k user who doesn't want to participate in moderation? Your experience on StackOverflow (which we moderators, 10k and diamonds, and other diligent users of SO put much effort into making so nice!) is now ruined. All the crap that is cleared out to make that experience so unique is now dumped right in your lap.

I'd suggest that there should be the ability for high-rep users to say, "thanks, but no thanks" to some of the "features" of being a high-rep user. I think that not wanting to see deleted trash would be first among them.

In other words, let the little moleyoutube link take off his spectacles so that this

trash heap

will look like this again

fairy castle

5
  • 3
    Kinda related: Has anyone out there tried to stop gaining rep so as to not surpass 10k?
    – Pops
    Commented Oct 28, 2011 at 16:35
  • +1 for the cartoon alone. I've never seen that one before. What company made it, or where is it from?
    – Mr.Wizard
    Commented Oct 28, 2011 at 23:40
  • @Mr.Wizard: I added a link (if you didn't notice). I don't know off hand, I just remember it as being one of those disturbing cartoons from childhood.
    – user1228
    Commented Nov 1, 2011 at 19:27
  • Thanks for the link, I had no idea what you were talking about before :-) Commented Nov 6, 2011 at 13:39
  • You can always set a ton of 500 reputation bounties on questions and eventually you will drop below 10k. Commented May 8, 2017 at 0:17
17

Here's a script which hides answers deleted by their owners or by mods over 30 days ago, and hides all deleted posts which were deleted over 90 days ago:

// ==UserScript==
// @name           So Delete Me
// @namespace      http://josh.gitlin.name/javascripts
// @description    Hide deleted posts with certain characteristics
// @version        1.0
// @include        http://stackoverflow.com/*
// ==/UserScript==

var script = document.createElement("script");
script.textContent = "(" + grease.toString() + ")()";
document.body.appendChild(script);

function grease()
{
    var hidePostsOlderThan = 3 * 30 * 24 * 60 * 60 * 1000; // Rough approximation of 3 months in miliseconds
    var hideModOwnerPostsOlderThan = 1 * 30 * 24 * 60 * 60 * 1000; // Rough approximation of 3 months in miliseconds
    
    hideModOwnerPostsOlderThan = 5 * 60 * 60 * 1000; // 5 hours in miliseconds
    
    var now = new Date();
    
    $('div.deleted-answer').filter(function(){
        var deletedAnswerInfo= $('div.deleted-answer-info',this);
        var deletedByOwner = deletedAnswerInfo[0].innerHTML.match(/deleted by owner/);
        var deletedByMod = deletedAnswerInfo[0].innerHTML.match(/deleted by.*moderator/);
        
        var dateParts=$('div.deleted-answer-info span',this)[0].title.match(/([0-9]+)-([0-9]+)-([0-9]+) ([0-9]+):([0-9]+):([0-9]+)(.)/);
        
        var deletedAt = new Date(dateParts[1],parseInt(dateParts[2])-1,dateParts[3],dateParts[4],dateParts[5],dateParts[6],0);
        
        var deletedAge = now - deletedAt;
        
        return (deletedAge >= hidePostsOlderThan) || ( (deletedByOwner || deletedByMod) && deletedAge >= hideModOwnerPostsOlderThan);
    }).hide();
}

Link to install into Google Chrome / Greasemonkey

I do not have 10K so I cannot test this script thoroughly. But it seems to work with a self-deleted answer. I just reached 10K on Meta Stack Exchange.

19
  • Find one of your own deleted answers.
    – John
    Commented Oct 28, 2011 at 16:29
  • It works, but the thing is: The OP wants to do it based on some criteria, so it doesn't apply to all deleted answers.
    – slhck
    Commented Oct 28, 2011 at 16:31
  • @John: I deleted this question and that's how I came up with that CSS. I just couldn't confirm it would work on other kinds of deleted answers. I have no idea what I am talking about here since I can only see my own deleted answers, which is why I said I can't confirm it works. Commented Oct 28, 2011 at 18:50
  • @slhck: I know. This was the best I could do in a short timeframe. maybe someone can create a usercornscript... (I'm looking in your direction Tim Stone...) Commented Oct 28, 2011 at 19:07
  • This would help a lot. Can I send you, or post somewhere, the page code for the thread in the question?
    – Mr.Wizard
    Commented Oct 28, 2011 at 23:43
  • Sute. Edit your question with some html. Commented Oct 29, 2011 at 0:54
  • (Relatve html especially e.g. owner or date or whatever you want filtered by) Commented Oct 29, 2011 at 1:21
  • I updated the question. Let me know if that is helpful.
    – Mr.Wizard
    Commented Oct 29, 2011 at 3:23
  • @Mr.Wizard That is helpful, thanks. Now, a few questions. You said you want to hide based on "age since deletion", what specifically do you want here? I'm also not clear on whether you want posts deleted by mods hidden or posts deleted by owners... or both? Finally, I can't see undelete votes, so if you could please show me how the HTML changes when there's undelete votes, then I can code for that. Commented Oct 29, 2011 at 13:39
  • I couldn't find an example of undelete votes myself. Perhaps I am looking in the wrong place, or I do not have access either. By "age since deletion" I mean I don't want to see anything that was deleted more than three months ago. If something was deleted by a diamond moderator, or deleted by owner, then I don't want to see any that are older than a month. This at least would be a place to start.
    – Mr.Wizard
    Commented Oct 29, 2011 at 14:11
  • @Mr.Wizard Done, see updated answer Commented Oct 29, 2011 at 15:35
  • Have you considered adding this to Stack Apps? :) Commented Oct 29, 2011 at 16:33
  • @Chris great idea, I think I will! Needs to be a bit more refined, probably should have a UI to enable/disable, etc. Commented Oct 29, 2011 at 16:36
  • I got around to trying this, and I am sorry to say it does not appear to work as implemented. I am using Greasemonkey/Firefox7.
    – Mr.Wizard
    Commented Nov 6, 2011 at 7:31
  • Does it just have no effect at all? Or does it hide the wrong posts / not hide enough posts? Commented Nov 6, 2011 at 13:31
7

Simple answer, AdBlock Plus can block this element: stackoverflow.com##.answer.deleted-answer. That's a bit of brute force and removes them all.

You can also use this TamperMonkey script with some help from jQuery to hide just the deleted by owner stuff:

// ==UserScript==
// @name         stackoverflow tampering
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  StackOverflow - hide #hot-network-questions and deleted stuff.
// @author       mattmc3
// @grant        none
// @require http://code.jquery.com/jquery-latest.js
// @match https://*.stackoverflow.com
// @match https://*.stackexchange.com
// ==/UserScript==
$(document).ready(function() {
  // hide just 'deleted by owner'
  $('.answer.deleted-answer:contains("deleted by owner"').hide();

  // or, hide all deleted answers
  // $('.answer.deleted-answer').hide();

  // you can hide other stuff too
  $('#hot-network-questions').hide();
});
3

Regardless of the criteria for hiding, there should be a "Show x deleted answers" link where the hidden answers would have been.

That would make the answers readily available if a comment or the like prompts you to look at the deleted answers, but would avoid the clutter in the common case of just getting your work done.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .