133

Is there a way to create a hyperlink without it auto resolving? I simply want some text I type to be clickable to some url when I post in slack. I don't see a way to do this yet.

PositiveGuy
  • 43,266
  • 106
  • 285
  • 457
  • 1
    Are you talking about [unfurling](https://api.slack.com/docs/message-attachments#unfurling)? – Adam Aug 23 '16 at 15:23
  • 13
    "Hyperlinking words and terms in a Slack message isn't supported." https://get.slack.help/hc/en-us/articles/204399343-Sharing-links-in-Slack – richie Mar 01 '17 at 06:55
  • 2
    Way to go Slack – Gayan Weerakutti Dec 24 '19 at 08:38
  • 3
    @oh_my_lawdy pointed out that it is now possible! (see answer below) – Philip Nelson Feb 26 '20 at 22:11
  • 4
    Voting to re-open. This is a question regarding "software tools commonly used by programmers", and is a "practical, answerable problem" so I see it as fitting squarely within the ["on-topic" list here](https://stackoverflow.com/help/on-topic). – Gabriel Staples Oct 15 '20 at 20:14

9 Answers9

118

Yes, Slack has the ability to hyperlink words, as long as Format messages with markup is unchecked under Preferences > Advanced to show the formatting toolbar. According to the documentation, start out with one of these:

  • Select text, then click the link icon in the formatting toolbar
  • Select text, then press ShiftU on Mac or CtrlShiftU on Windows/Linux.

Then do this:

Copy the link you'd like to share and paste it in the empty field under Link, then click Save.


What follows is how this answer used to read when it first became so famous. It was correct until about February 2020.

No.

As a couple of commenters said, and as the Slack documentation says:

Note: It’s not possible to hyperlink words in a Slack message.

Gary Sheppard
  • 3,877
  • 3
  • 20
  • 33
  • 18
    That's unfortunate. Especially since the internal Slack message links are long/unwieldy, so linking someone to a previous comment is unpleasant. (unless it's near the start/end of a thread, in which case you can just comment in that thread and then "send to channel") – Venryx Oct 28 '19 at 22:33
  • 1
    This is not true anymore. You can create links, see section "Link" https://slack.com/intl/en-ca/help/articles/202288908-Format-your-messages-Format-your-messages Select text, CMD/CTRL + SHIFT + U, insert link I couldn't get it to work though.. – GuiSim Mar 04 '20 at 13:05
  • 3
    Oh no! All my beautiful upvotes! I will update my answer to point to the now-correct answer. – Gary Sheppard Mar 04 '20 at 16:04
  • 15
    Please keep in mind that in order for this to work, you (unfortunately) must disable the markup feature. Here's how to do that on macOS: (1) Slack » Preferences (presumably File » Preferences on Windows) (2) Ensure that Advanced » ◻️ Format messages with markup is left unchecked – ilyakam Mar 06 '20 at 01:07
  • 1
    YMMV. As of 2020-03-26, the documentation says: "Note: We’re in the process of gradually rolling out the ability to format your messages with hyperlinks on desktop and mobile. If you’re not seeing this functionality yet, please stay tuned." – Kittsil Mar 26 '20 at 16:19
  • 55
    Thanks @ilyakam … why can't they just adopt the bog-standard Markdown way of titling links `[title stuff](http://url.goes.here)` ??? – Dan Lenski Jun 10 '20 at 19:46
  • 2
    This does not seem to work if you want to use markdown in your messages and thus disabled the formatting options unfortunately. So there is no way to create linked text then, it seems. – fritzmg Jun 30 '20 at 09:24
  • 8
    @DanLenski almost feels like that decision is meant to force people to adopt the toolbar by holding on to the hyperlinking feature exclusively. Deeply annoying, I agree. – Aditya M P Aug 12 '20 at 23:42
  • 1
    @AdityaMP, agreed. Other features that are inexplicably lacking from Slack's text input, but allowed with Slack WYSIWYG input… and yet exist in Markdown and could be straightforwardly adopted: bulleted lists, numbered lists, strikethrough. – Dan Lenski Aug 13 '20 at 00:40
  • 3
    For what it's worth, I tried [their docs for app surfaces](https://api.slack.com/reference/surfaces/formatting#linking-urls), which say to use `` syntax, but I can confirm it doesn't work, and it turns into some weird link that combines the parts with url escaping. – 2rs2ts Sep 10 '20 at 23:53
19

In addition to the ShiftU/CtrlShiftU solution, you can also add a link quickly by doing the following:

  1. Copy a URL to the clipboard
  2. Select the text in a slack message you are writing that you want to be a link
  3. Press V on Mac or CtrlV

I couldn't find it documented anywhere, but it works, and seems very handy.

splintor
  • 8,690
  • 4
  • 64
  • 85
13

Slack now supports hyperlinks natively in the message composer using the Link button or shortcuts:

  • Mac: cmd+shift+U
  • Windows/Linux: ctrl+shift+U

https://slack.com/help/articles/202288908-Format-your-messages-Format-your-messages

Philip Nelson
  • 952
  • 8
  • 23
oh_my_lawdy
  • 340
  • 3
  • 10
  • 1
    I saw this as well, but it doesn't work for me in v4.3.3 on a Mac. Perhaps it's not in the latest release yet? – Cory W. Feb 27 '20 at 19:50
  • 7
    In v4.3.2 on Ubuntu, this shortcut removes the selected text and replace it with a "u". – GuanacoBE Feb 28 '20 at 08:57
  • @CoryW. I'm also on v4.3.3 on Mac and have it working. Maybe restarting the app or your machine will fix that. – oh_my_lawdy Feb 28 '20 at 13:54
  • 2
    @CoryW. on their [formatting help article](https://slack.com/help/articles/202288908-Format-your-messages-Format-your-messages) they mention "Note: We’re in the process of gradually rolling out the ability to format your messages with hyperlinks on desktop and mobile. If you’re not seeing this functionality yet, please stay tuned." so it's possible that it hasn't been rolled out to your workspace yet. – abagh0703 Mar 01 '20 at 21:09
  • 9
    This does not work if you have the wysiwyg editor disabled. – Timmmm May 18 '20 at 08:54
  • 5
    On ubuntu, ctrl + shift +u is a shortcut do enter a unicode character. – Filip Stachowiak May 18 '20 at 12:55
  • 1
    It's very unfortunate the shortcut is not the same CTRL+K used to insert a link is almost every other editor I use, such as Google Docs. That and the CTRL+SHIFT+U is how I enter Unicode on Arch Linux as well... – Charlie Gorichanaz Jul 16 '20 at 21:05
12

I am not sure if this is still bothering you but take a look at this page for slack text formatting:

https://api.slack.com/docs/message-formatting#linking_to_urls

For example using Python and the slack API:

from slackclient import SlackClient
slack_client = SlackClient(your_slack_token)
link_as_text_example = '<http://www.hyperlinkcode.com/|Hyperlink Code>'
slack_client.api_call("chat.postMessage", channel=channel_to_post, text=link_as_text_example , as_user=True)

You can also send a more advance JSON following the link: https://api.slack.com/docs/message-attachments

user159941
  • 311
  • 5
  • 14
6

you can try quoting it which will keep the link as text. see the code blocks section: https://get.slack.help/hc/en-us/articles/202288908-Format-your-messages#code-blocks

Edward Ashak
  • 2,251
  • 1
  • 19
  • 37
  • 8
    From the page you linked: Note: Hyperlinking words and terms in a Slack message isn't supported — to include a URL, paste it into the message input box. Visit Share links in Slack for more. – Christopher Apple Jul 18 '17 at 18:29
  • 1
    @RıfatErdemSahin apparently not. Hyperlinking words and terms is not supported in Slack. – wintermute May 22 '18 at 17:49
  • why we need that and i was also anle to do that but dont know why it does not work from time to time. Slack needs a better debugger...or a debugger... – Rıfat Erdem Sahin May 27 '18 at 22:00
4

UPDATED ANSWER:

As per the documentation:

  • Select text, then click the link icon in the formatting toolbar
  • Select text, then press ShiftU on Mac or CtrlShiftU on Windows/Linux.

Copy the link you'd like to share and paste it in the empty field under Link, then click Save.


Juts for fun: how we did it at times when Slack allowed rich formatting but did not allow user hyperlinks (previous version of the answer):

To do this you must first create text with the desired hyperlink in an editor that supports rich text formatting. This can be an advanced text editor, web browser, email client, web-development IDE, etc.). Then copypaste the text from the editor or rendered HTML from browser (or other). E.g. in the example below I copypasted the head of this StackOverflow page. As you may see, the hyperlink have been copied correctly and is clickable in the message (checked on Mac Desktop, browser, and iOS apps).

Message in Slack

On Mac

I was able to compose the desired link in the native Pages app as shown below. When you are done, copypaste your text into Slack app. This is the probably easiest way on Mac OS.

Link creation in Pages

On Windows

I have a strong suspicion that MS Word will do the same trick, but unfortunately I don't have an installed instance to check.

Universal

Create text in an online editor, such as Google Documents. Use Insert -> Link, modify the text and web URL, then copypaste into Slack.

enter image description here

greatvovan
  • 1,217
  • 11
  • 29
2

python

x = "http://xxxxxx"
y = "text title"
text_link = '<{}|{}>'.format(x,y)

post text_link in using python slack client

Amir
  • 101
  • 3
1

I feel like none of these messages quite answer the question still. See - https://api.slack.com/docs/message-attachments.

It requires you to put the link in an attachment. Hyperlinking is still not allowed in the body of the message.

{ "attachments": [ { ..., "text": " <https://honeybadger.io/path/to/event/|ReferenceError> - UI is not defined", ... ] }

ReferenceError will be a hyperlink.

archeezee
  • 381
  • 3
  • 15
0

I know you wanted only a hypertext link, but if you copy & paste a link address into Slack that does work very nicely. i.e. if referring to VersionOne ticket number (V1 mouseover the ticket window to open the mouseover window, then right click on the ticket number for the option to "copy link address", then in Slack paste. It'll paste the full ticket URL but then it shows a nice summary of the ticket number and name and you can click it to go right into the ticket.)

Christine
  • 27
  • 1