168

The increase in the character limit of comments has led them to become as important as the questions and answers that spawn them. On several occasions (especially on meta) I've found reason to want to link to a comment directly. I'd imagine something as simple as making the date / time stamp an anchored link which mimics the behavior of the question link.

4
  • 14
    It's so weird when fanboys or people involved in something (people who make, use or support something) act like any questioning of the system or feature request, etc., is some kind of horrible attack and they knee-jerkingly attack the heretic who proposes it. I asked an accidentally duplicate question (I tried looking for "permalink"ing comments and didn't find it, so I made my own) and had the same kind of responses. But when they decide to go with it? Universal flip-flopping. In general, I don't like meta.stackoverflow because of this tendency to reject everything anybody says ever.
    – vbullinger
    Mar 6, 2012 at 17:36
  • 1
    Direct comment links should be more intuitive, e.g. having permalink icon - see Improve the usability/intuitiveness of direct comment links Jun 25, 2016 at 1:56
  • 4
    This comment links to itself.
    – Nae
    Dec 26, 2017 at 13:28

6 Answers 6

153

This appears to be officially supported now:

permalink to comments

Right clicking on the timestamp gives what looks like a stable URL:

https://meta.stackexchange.com/questions/5436/direct-link-to-a-comment#comment1232412_5436

18
  • It comes from the SE modifications user script. Have you installed that?
    – ChrisF Mod
    Jan 30, 2012 at 10:56
  • 2
    @ChrisF - nope, haven't installed that. Not seeing it on main either and chat.meta.stackoverflow.com/transcript/message/849109#849109 seemed to agree.
    – Flexo
    Jan 30, 2012 at 10:58
  • That is new then.
    – ChrisF Mod
    Jan 30, 2012 at 10:59
  • I see that only on MSO and not on SO/SU. Is this a meta-only feature? I can imagine it being a little tricky if the comment thread were folded. (edit: ah.. just read the link to chat transcript)
    – Shawn Chin
    Jan 30, 2012 at 16:40
  • @ShawnChin It's enabled network-wide (though it's not as easy to tell on non-Meta sites due to the styling)
    – Tim Stone
    Jan 30, 2012 at 17:16
  • @TimStone doesn't work for me on SO, no matter how I poke it.
    – Shawn Chin
    Jan 30, 2012 at 17:21
  • @ShawnChin - I'm not seeing it outside of meta yet. I assume that means it's not made it that far on its rollout yet.
    – Flexo
    Jan 30, 2012 at 17:27
  • @ShawnChin Oh, weird...it's been enabled everywhere for me since last night, I even disabled all of my extensions to be extra sure (Since I had to update SEModifications to remove this feature).
    – Tim Stone
    Jan 30, 2012 at 17:29
  • Might also be I have a script cached with a long expiry for main
    – Flexo
    Jan 30, 2012 at 17:33
  • Ah well, I'll try again tomorrow. I'm in no hurry to use this feature. Just curious to see how it handles links to comments that have been folded.
    – Shawn Chin
    Jan 30, 2012 at 18:02
  • @ShawnChin It expands them, then brings you to the comment. That part's been in place for some time, if you go to your responses tab and click a link to a (hidden) comment on an answer, you should be able to see it in action.
    – Tim Stone
    Jan 30, 2012 at 18:18
  • 3
    Cool. I now see it on the other sites as well.
    – Shawn Chin
    Jan 31, 2012 at 10:09
  • 2
    "Right clicking on the timestamp"? Left click seems to work well. With FireFox, after a right click, you need to e.g. "Copy Link Location". Jan 3, 2014 at 17:12
  • @jos yes right click - left click causes a whole bunch of network traffic and loses what I've typed into form controls in Firefox.
    – Flexo
    Jan 3, 2014 at 17:56
  • 1
    Although this works, it's not obvious / user-friendly. A tool-tip on hover (e.g. "Click to share") would be helpful.
    – Jim Fell
    Oct 17, 2018 at 14:13
24

FWIW, you can link to comments by combining the URL used behind the scenes to retrieve them with the internal ID for the specific comment:

https://meta.stackexchange.com/posts/27319/comments#comment-57475

However, this relies on specific aspects of the current implementation, and there's no guarantee they won't change at some point in the future. Don't count on these links being permanent!

Or, even worse, combining the permalink of an answer (to ensure proper pagination) with the id of a comment, which however might not be shown on a page if there's too many comments, or if it's deleted (and hence would result in the page not scrolling at all):

Direct Link to a Comment

Links from the profile page currently use a slightly different format, where the comment ID has the answer ID appended to it (comment-<commentID>_<answerID>): comment-57475_27319 - this triggers a bit of client-side script that'll scroll to the proper answer and expand comments... So it works great, but again: very implementation-specific, so be wary of using this anywhere it has to keep working long-term (at least for now): if the format changes, this won't even be recognized by the browser as a valid ID.

For a userscript that'll make this easier, see the SEModification.user.js available here.

13
  • 3
    Oh, that's rather...
    – random
    Oct 26, 2009 at 16:06
  • Interesting. But it takes the comment completely out of context. :) I'd hope to be able to link directly to this comment in the page flow.
    – ahsteele
    Oct 26, 2009 at 16:53
  • 3
    If you know it's in the top n comments and will therefore be displayed by default on page load, you can use a similar hack: meta.stackexchange.com/questions/5436/direct-link-to-a-comment/… ...But this is even more likely to break, since it's quite possible for a comment to disappear off of the page (too many answers, additional, up-voted comments...)
    – Shog9
    Oct 26, 2009 at 18:30
  • Actually: you currently know it's in "the top n" if it has at least one upvote. Hence, upvoting before linking might currently do the trick, like here... Still then: if the comment is deleted (or if the rendering is changed), the browser won't even scroll to the answer it might have belonged to. So: not really a permalink indeed.
    – Arjan
    Sep 11, 2010 at 11:09
  • Okay, I was wrong in my last comment too. Some posts may have too many upvoted comments, and then even hide upvoted comments...
    – Arjan
    Oct 2, 2010 at 9:57
  • It seems to me that permalinking to comments in the context of an answer would be possible if Auto expand comments of specific answer when browsing directly to that answer were implemented. Still then, deleted comments would not scroll the page at all, but show no error. Also, this might still not work for comments on questions. (And finally: if a comment is close to the bottom of the page, the browser might not scroll all the way down either.)
    – Arjan
    Feb 8, 2011 at 22:10
  • @Arjan: I think it's pretty safe to say that this will never be a well-supported use-case for SO. If you have something important and want to link to it, edit it into an answer (and, optionally, support in-answer anchors)
    – Shog9
    Feb 8, 2011 at 22:51
  • @Shog9 how do I "combine the permalink of an answer (to ensure proper pagination) with the id of a comment" ? I want to link to japanese.stackexchange.com/questions/3223/… (as you can see there's too many comments so it's linking to the wrong place)
    – Pacerier
    Sep 25, 2011 at 19:24
  • @Shog9 - Now (2011-09-26) that this is a feature - at least from the profile page - can we assume that comment links are permanent? Sep 27, 2011 at 15:01
  • @Pacerier: this appears to work a little better now...
    – Shog9
    Sep 27, 2011 at 15:18
  • 1
    @Kevin: The profile-page links are... a little bit different from those described here. I wouldn't necessarily depend on them being permanent, but you can probably trust them to at least get you to the right answer.
    – Shog9
    Sep 27, 2011 at 15:20
  • @Shog9 ok I understand the hack now lol
    – Pacerier
    Sep 28, 2011 at 13:04
  • For what it is worth - sounds nice - you get the comment id from the timestamp or is there another way to retrieve it? Jul 12, 2021 at 19:47
10
+50

This also works:

https://meta.stackexchange.com/posts/comments/943975

3
  • this is to demonstrate answer above
    – Zombo
    Feb 7, 2017 at 4:09
  • 2
    True, but for this you need to get the comment ID first. Feb 7, 2017 at 7:12
  • 2
    This is sometimes useful when you need to link to a comment but you have to keep in mind also character limit. (For example, when writing comments.) And also in some other situations - for example, in connection with the problem I described here: Links to comments when the title has been edited.
    – Martin
    Jan 10 at 5:40
8

This would actually be really helpful for people who flag comments - being able to move directly to the item flagged.

0
5

I just can't see any legitimate need to deep link (permalink) to a comment.

Conceptually, they are too ephemeral compared to answers and questions. And on top of that, whether a comment is visible or not is completely dependent on how many other comments there are and how highly they are voted, among other variables...

Linking to the question or answer should be sufficient, I think.

edit: we do have a way to deep link to comments now, I believe -- I'll check and provide details.

10
  • Comments last only one day? :-P I disagree as Kip's answer clearly shows how linking to a comment would have helped you with your blog post.
    – ahsteele
    Mar 30, 2010 at 22:54
  • 10
    You can’t see a reason to permalink to a comment Jeff? It sounds like you’re still thinking of comments as short, not-very-helpful, me-too/thanks type things. Perhaps you should take a look at some of the posts on Meta about comment-answers. Then maybe you’ll see a need for being able to link directly to comments.
    – Synetech
    Feb 3, 2011 at 13:46
  • Interesting that this has since been implemented. Jun 23, 2011 at 14:34
  • 1
    "I just can't see" Says the blind man.... Sometimes I get a response that appears useless except when in context of the comment thread. It's sad that I have to use the browsers search function once expanding comments to actually find the comment buried in what would appear to be a wall of text otherwise. Jun 23, 2011 at 15:02
  • @xaade we explicitly suppress comments and discussion; it's hard for a reason, like driving your car on the sidewalk is supposed to be hard. Jun 23, 2011 at 22:57
  • Jeff did this recently get implemented? Seems like comments are now all expanded by default and that links from the activity page jump directly to comments.
    – ahsteele
    Sep 10, 2011 at 6:23
  • 1
    @JeffAtwood: If comments were ephemeral (lasting a short time, is that really what you meant?) then why was the size of comments bumped up to 600 characters? If they are not supposed to be of any importance then why do something that gives them more importance?
    – casperOne
    Nov 16, 2011 at 17:40
  • No, Jeff was right. Comments were intended to be "ephermeral" (short-lived), are easily deleted, and can be removed by someone else by a simple flag.
    – bobobobo
    Jan 30, 2012 at 17:11
  • 2
    Linking to comments in chat is useful. Jan 22, 2013 at 0:20
  • Jeff answered to a comment from @xaade, but the comment is not there/deleted. I hate this form of incomplete info. Jul 13, 2021 at 6:51
2

I agree, this has been a problem for me too a few times, mainly in meta-SO. It would have helped Jeff to link to me and TXI's bad joke in a recent SO blog post too! :)

3
  • See that alone should seal the deal. ;)
    – ahsteele
    Jul 15, 2009 at 3:56
  • 1
    linking to the post is sufficient-ish -- comments are right there under the post Mar 30, 2010 at 23:24
  • 7
    Answers are right under the question.... let's get rid of answer links. I was taught as a Customer interface designer, to put things where users look for them. It's not the producer that uses the product, it is the user. Jun 23, 2011 at 15:04

You must log in to answer this question.

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