Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create Hyperlink in Slack [closed]

Tags:

slack

People also ask

How do I collapse links in Slack?

Go to the link shared in Slack and click the grey X in the corner of the preview, and in the popup message, check Disable future attachments from this website? And from the dropdown menu, select All links from [domain name].

Can you hyperlink to a Slack channel?

To create a clickable reference to a channel in a Slack conversation, just type # followed by the channel name. For example: #general .

Can you hyperlink in Slack API?

Links. URL links are automatically hyperlinked in Slack without additional formatting. To display link text instead of the URL: Type an open angle bracket (<), your URL link, a pipe character (|), your link text, and a closing angle bracket.


At some point in 2020 or 2021, Slack added the ability to hyperlink text using either the formatting toolbar or markup, which most of us would call Markdown. According to the documentation for formatting messages and setting your message formatting preference, if you want to use markup, you have to first set your preference to Format messages with markup, and then you can link text in the usual Markdown way:

Here comes a link: [a link to Stack Overflow](https://www.stackoverflow.com)

What follows is the second version of this answer when Slack first added the ability to hyperlink words. It was correct until sometime in 2020 or 2021.

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.


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.


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


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


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


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