Insert a Link with the BlockNote Editor

Last modified by Eleni Cojocariu on 2026/11/24 18:52

Steps

To insert a link with the BlockNote editor:

  1. Select the text to turn into a link.
  2. Click the link button of the formatting toolbar.

    The formatting toolbar of the BlockNote editor with the Create link button highlighted

  3. Choose the target in the "Insert link" modal. The selected text is already filled in as the target, and, for a link to a Page, the Pages matching it are suggested: pick one, or choose another "Link type" and type the target. The fields of the modal are listed in BlockNote Link Options.

    The Insert link modal, with the selected text release plan as the Page reference and the suggested Pages highlighted

  4. Click "Insert". The link appears in the content, ready to be followed once the Page is saved.

    A link inserted in the content of the BlockNote editor, shown inside the sentence it belongs to

XWiki <18.10.0 The modal opens with an empty target, and its "Display text" field comes first. Before 18.7.0RC1, a popover with a single address field replaces the modal.

XWiki 18.10.0+

A link can also be inserted without selecting any text first:

  1. Type /link to open the "slash menu", and select "Link".

    The slash menu of the BlockNote editor with /link typed and the Link entry highlighted

  2. Choose the target of the link in the menu that opens. It offers "Link to..." and "Upload file..." at the top, followed by up to eight suggestions, grouped in "Pages" and "Attachments".

    The link menu of the BlockNote editor, listing Link to..., Upload file..., then the suggested Pages and Attachments, highlighted

    • Pick one of the suggested Pages or Attachments. Without a search, these are the Pages most recently modified and the Attachments most recently uploaded. Type a few letters to search them. The menu shows five Pages and three Attachments when there are enough of both; when one group has fewer, the other one takes the free places. The location of a suggestion is shown below its name.
    • Select "Upload file..." to choose a file of any type on your computer. The file is attached to the Page, and the link points to it. This action is not offered when you are not allowed to upload files, for example when adding a comment to a Page you can't edit.
    • Select "Link to..." to open the link modal, to link to anything else, such as an external URL or an email address, or to set the display text and the other options of the link. The text you typed to search is filled in as the target.

The link is inserted at the cursor position, with the title of the Page, or the name of the Attachment, as its text. This text is not saved with the link: it is generated from the target each time the Page is displayed, and by default it is the name of the Page, which can differ from its title. If you change the text of the link, your text is saved instead.

You can also open the link menu without the slash menu: type [[ followed by the text to search for, such as part of the title of the Page or of the name of the Attachment.

The following video links a selected text, then uses "Link to..." from the link menu, edits a link and links to a URL typed without https://:

XWiki 18.10.0+

Paste or Drop a File

You can also paste a file, or drop it from your computer over the content. The file is attached to the Page, and a link to it, with the file name as its text, is inserted where the cursor is for a pasted file, or where you drop it. When you paste or drop several files at once, their links follow each other, separated by a space.

A chart pasted as an image block in the BlockNote editor, followed by a sentence ending with a link to the dropped file meeting-notes.pdf

A pasted file is renamed after the moment it was pasted, for example 1795511861570-260.pdf. A dropped file keeps its name, and replaces the Attachment of the Page that already has that name, if any.

Images are inserted as images rather than linked, see Insert an Image with the BlockNote Editor. When you paste or drop images together with other files, each file gets a block of its own: the images an image block, the other files a paragraph holding their link, placed like the images.

When a file can't be uploaded, nothing is inserted and an error message names it. Pasting or dropping files does nothing when you are not allowed to upload files. Outside a realtime collaboration session, the files are attached to the Page only when you save it; in a realtime session, they are attached right away.

The following video drops an image, pastes a second one, then drops a PDF file:

XWiki <18.10.0

Since 18.8.0RC1, a link can also be inserted without selecting any text first: type /link to open the "slash menu" and select "Link". The link modal opens with its display text field focused; fill in the display text and the target, then submit. The link replaces what you typed, at the cursor position.

The slash menu of the BlockNote editor with /link typed and the Link entry highlighted

FAQ

How do I change a link I already inserted?

Hover the link, or place the caret inside it. The toolbar that appears offers to edit the link, to open it and to remove it. Editing it opens the link modal, under the title "Edit link".

More

To find more about the current topic, you can search or use the table below and filter the columns to narrow your choices.

Related

Get Connected