When a hyperlink is created in a notebook, there does not seem to be an easy way to actually edit the hyperlink (maybe to correct the URL).

To hyperlink some text, one selects the text using the mouse, then right-clicks and then selects Make HyperLink..., then a popup menu comes up where one enters the URL. Then clicks OK and the hyperlink is made.

Mathematica graphics

Now the text becomes a hyperlink.

But how can one bring this menu back up in order to modify the link if needed? Right-clicking on the now hyperlink does not bring up the above menu used to create the hyperlink.

Selecting the cell and choosing Cell ▸ Show Expression (Cmd/Ctrl+Shift+E) is not really practical, as the cell can be very large and contain many links.

The question is: How to bring up the original menu used to make the hyperlink in order to modify a specific link?

  • $\begingroup$ I don't know any way to bring the dialog box back. When I need to edit a hyperlink, I isolate it into its own cell with command-shift-d (ctrl-shift-d on Windows?) and then type command-shift-e to work on the raw cell. Afterward, I merge the hyperlink back into the cell it was extracted from with command-shift-m. Have you tried that? $\endgroup$
    – m_goldberg
    Commented Dec 28, 2012 at 2:54
  • 4
    $\begingroup$ Your isolated hyperlink doesn't look, to me, like it would be difficult to edit. Maybe it's just that I've grown accustomed to such editing. I've done it fairly often. $\endgroup$
    – m_goldberg
    Commented Dec 28, 2012 at 3:15
  • $\begingroup$ Your friendly neighborhood keyboard shortcut lookup service here: Cmd/Ctrl-Shift-D is Divide Cell, and Cmd/Ctrl-Shift-E is Show Expression. $\endgroup$
    – duozmo
    Commented Dec 12, 2015 at 3:39

1 Answer 1


To make this working reliable with links in input-cells, links created with Hyperlink or links created with Insert->Hyperlink seems a mess, since all those links have a different nested structure.

Let me start easy: The next should definitely work with links that were created with Insert->Hyperlink (or Ctrl+Shift+H) in text or input cells.

The trick is to use Options when the link is selected. First a simple test: Create a text-cell with a link in it and mark the link. Then press this button

Button["Options", Print@Options[NotebookSelection[SelectedNotebook[]]]]

and you get something like


ButtonData is the link of the target and I haven't tried to find out what the None means. The ButtonNote is the information which is displayed in the status bar of the notebook when you are over the link with the mouse.

Since we can use SetOptions to change those settings the things left to do are to create a button which has the following behavior when pressed

  • It extracts the Options of the selected expression.
  • It checks whether this is a hyperlink.
  • It pops up a DialogInput with the old value of the link which can be edited.
  • It sets this new content using SetOptions.

Here we go

Button["Edit Hyperlink",
 Block[{sel, data, opts, newlink},
  sel = NotebookSelection[SelectedNotebook[]];
  opts = Options[sel];
  If[FreeQ[opts, ButtonBoxOptions],
   MessageDialog["Couldn't identify hyperlink"],
   data = ButtonData /. (ButtonBoxOptions /. opts);
   newlink = DialogInput[{url = First[data]},
       "Target page",
       InputField[Dynamic[url], Expression],
       Button["OK", DialogReturn[url]]
   If[newlink =!= $Canceled && newlink =!= $Failed,
     opts /. (ButtonData -> _) -> (ButtonData -> {newlink, 
   ]], Method -> "Queued"

Links created with Hyperlink

This works too with the above code, the difficulty is to select the right expression. Try to create an example Hyperlink["A Link", "http://www.wolfram.com"] and now use the arrow-keys to move the cursor inside the link (maybe between the L and the i) and then press Ctrl+. over and over again to extend the selection stepwise. It requires 6 times until I have selected the whole cell.

After hitting 4 times Extend Selection I have selected the right level of the expression and the Options button of my first code-block shows me

{Active->True, ButtonBoxOptions->{

This is the right level, where the Edit Hyperlink will work.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.