I want to create a URL that uses org-id to jump to its associated heading in Emacs org-mode.

I tried using:


But this only opens Emacs with a blank *scratch* window. It does not actually navigate anywhere... am I missing something?

Also, I notice that each time I enter this link in my browser, I get a pop-up message, asking if I want to allow "Safari/Firefox/Chrome/Etc." to open Emacs. Is there anyway to disable this message for the future?

  • Read the "Usage" section at the beginning of org-protocol.el. Briefly, you need to start the emacs server in your emacs and use emacsclient to connect. Once that works, then you can try adding it to external applications.
    – NickD
    Feb 22, 2019 at 11:58
  • @NickD I don't think we are talking about the same thing. I am looking to build a URL that will click through to a heading in an org document, regardless of what app you are using to click through. Railwaycats Emacs appears to already be setup with the org-protocol syntax. But for some reason is not responding to org-id-goto...
    – Adam
    Feb 22, 2019 at 16:39

1 Answer 1


I'm doing the same thing as you under the inspiration of Roam Protocol

You can't use the built-in org-id-goto directly, you have to custom your own org-protocol handler first. Here's the way I do:

(add-to-list 'org-protocol-protocol-alist
             '("org-id" :protocol "org-id"
               :function org-id-protocol-goto-org-id))

(defun org-id-protocol-goto-org-id (info)
  "This handler simply goes to the org heading with given id using emacsclient.

    INFO is an alist containing additional information passed by the protocol URL.
    It should contain the id key, pointing to the path of the org id.

      Example protocol string:
  (when-let ((id (plist-get info :id)))
    (org-id-goto id))

Then, if you open link like org-protocol://org-id?id=309A0509-81BE-4D51-87F4-D3F61B79EBA4 in a web brower, it will jump directly to the heading with id 309A0509-81BE-4D51-87F4-D3F61B79EBA4 in emacs.

Also, here's a snippet for getting this kind of org-protocol link from current heading:

(defun org-id-protocol-link-copy ()
  (org-kill-new (concat "org-protocol://org-id?id="
  • Thanks for this! Adding (select-frame (make-frame)) before (org-id-goto id) helps if you have multiple frames open, where it might be harder to find which frame the link was opened in.
    – Mark
    Nov 15, 2021 at 20:34
  • 1
    Works perfectly. For those using Mac OS X, you'll need to make the OS aware that the custom URL (org-protocol://) should invoke emacsclient. This site describes a way to do that.
    – midas0441
    Jan 26, 2022 at 17:02

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.