How can I paste a link to a URL with custom text in Confluence?
Asked by Andy McLaughlin:

I've got a Google spreadsheet that I'm trying to use to generate links to a lot of files.

```
This question?'s answer shows that you can use the syntax 

[Text to display|https://url-to-link.com] 
```

and Confluence will render it as [Text to display](https://url-to-link.com)   

However, when I copy my links with that format into a table in Confluence, they get rendered as \[Text to display\|<https://url-to-link.com> \]. If I manually type them out, they work as expected.  

Is there any way that I can copy and paste a lot of links into a table and have Confluence render them the way I want?  

The links I'm using are very long, so I don't want to display the full URLs in the table. There's also a lot of them, so it would be tedious to type all of these out manually.  


Answers:
author: Ryan Carpenter
body: If copying and pasting each link individually, you can

* paste as plain text (ctrl+shift+v is supposed to work. I find that I need to right click instead) or
* click on each url in the editor and choose *Unlink*
* paste the url as a link without entering the text to display. Next, change the text of the link, either by typing over it (i.e., place cursor in the linked url and start typing, then delete extraneous characters) or by clicking the link and choosing *Edit*.
* Use the insert link shortcut (ctrl+k). You can type the text to display before or after using the shortcut. Of the one-at-a-time options, this is probably the best approach. You can do it all without leaving the keyboard, just like typing out the full syntax.

To create all the links at once, you can create the syntax in a spreadsheet, then paste the preformatted links directly into a confluence table. Unlike typing a left bracket (\[), pasting multiple items into the page does not trigger the link creation functionality, you get plain text that does not 'turn into' a link until you save the page. Just make sure the url in the spreadsheet is plain text and not a link.

comments: author: Andy McLaughlin
body: I'm not sure what you're recommending in that last paragraph. If I copy and paste all of them at once, the URLs get turned into links without the specified text and brackets like this: \[Text to display\|<https://url-to-link.com> \]


author: Ryan Carpenter
body: I have used this approach before, but I am afraid you are right. Let me see if I can find what changed.


author: Andy McLaughlin
body: Thanks for looking into it, but I think I'm going to just brute force it. The fastest and most accurate way I've found is to paste all of the URLs into the table, click one, click Edit, Triple-click the Link Text box to select all, then paste in my desired text. I want all my links to have the same text, which makes this easier. If I wanted different text for each one, I'd have to copy from my spreadsheet on each one before pasting.


author: Ryan Carpenter
body: I must be remembering from long ago when the editor let you switch between html and wikitext. The bulk paste option still works for links to confluence pages, but not for urls. One more possible option is to use the source editor, if available to you. Good luck!


Tags: confluence-server

server