29

There is a user on the main site who leaves meaningless or useless comments in one particular tag that I am active in. Those comments do not warrant anything other than NLN flag, and that user is very active, at least in recent months, so I don't see any reason for them to suddenly stop doing it.

But these comments are very irritating, and making me to consider leaving that tag.

I thought maybe there is a way to simply hide all their comments under any posts for me? It could be a nice middle ground: they keep posting their stuff, and I keep my nerves intact.

I imagine something like userscript, that allows to specify a user whose comments to hide on which site.

5
  • 8
    Related: How can I block a user?
    – Ryan M Mod
    Commented Jul 14, 2023 at 18:38
  • 12
    if you weren't agitated, I would have suggested that you just keep flagging them instead of turning a blind eye.
    – starball
    Commented Jul 15, 2023 at 0:34
  • 8
    @starball, once strike is over, I'll reconsider my position. But for now, this is the only viable solution I can see.
    – markalex
    Commented Jul 15, 2023 at 6:13
  • 2
    Stack Overflow isn't exactly a healthy place to be if trivial things like comments get to you. What will be the next thing that other people do that you will choose to let yourself be emotionally influenced by? IMO this is training, don't hide the training material. Use it to become a more resilient person.
    – Gimby
    Commented Jul 18, 2023 at 9:21
  • 1
    @Gimby, let me use an analogy: one can train to tolerate barbed wire, but I don't think this is of any use for me, especially considering the cost. Outside of SO I successfully avoid especially irritating people and their unsolicited opinions, and would like to do it here too. I don't want any residency training, I want to help people where I can, preferably with as low of a cost for me in terms of irritation.
    – markalex
    Commented Jul 18, 2023 at 11:16

1 Answer 1

55

You would need to write a custom userscript or user style to target comment elements in the DOM that match only content where that user is the author.

The markup for a comment's container contains this attribute that you can key off of (for a CSS selector): data-comment-owner-id="" whose value matches the SO user ID of the author.

So this would hide all comments written by you, markalex (userid 21363224):

ul.comments-list li.comment[data-comment-owner-id="21363224"] {
    display: none;
}
4
  • 20
    Thank you very much! With help of this answer and your CSS I've successfully hidden those irritating comments. And it's nice that no additional plugins required for this.
    – markalex
    Commented Jul 14, 2023 at 19:45
  • 1
    If you change the selector to .comment[data-comment-owner-id="21363224"] div, you can avoid !important.
    – Nick ODell
    Commented Jul 16, 2023 at 21:56
  • 3
    @NickODell That would still leave each comment's li parent as an empty stub, which feels a bit less clean to me. I will update the answer with a more specific selector that removes the entire li and doesn't require !important.
    – TylerH
    Commented Jul 17, 2023 at 13:36
  • OMG THAT WAS SO SATISFYING. The one drawback for Chrome seems to be I have to override the entire CSS file and if the version hash changes I have to do it again. Commented Feb 4 at 14:08

You must log in to answer this question.

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