Skip to main content

4.4 External Links

Org supports links to files, websites, Usenet and email messages, BBDB database entries and links to both IRC conversations and their logs. External links are URL-like locators. They start with a short identifying string followed by a colon. There can be no space after the colon.

Here is the full set of built-in link types:

β€˜file’​

File links. File name may be remote, absolute, or relative.

Additionally, you can specify a line number, or a text search. In Org files, you may link to a headline name, a custom ID, or a code reference instead.

As a special case, β€œfile" prefix may be omitted if the file name is complete, e.g., it starts with β€˜./’, or β€˜/’.

β€˜attachment’​

Same as file links but for files and folders attached to the current node (see Attachments). Attachment links are intended to behave exactly as file links but for files relative to the attachment directory.

β€˜bbdb’​

Link to a BBDB record, with possible regexp completion.

β€˜docview’​

Link to a document opened with DocView mode. You may specify a page number.

β€˜doi’​

Link to an electronic resource, through its handle.

β€˜elisp’​

Execute an Elisp command upon activation.

β€˜gnus’, β€˜rmail’, β€˜mhe’​

Link to messages or folders from a given Emacs’ MUA.

β€˜help’​

Display documentation of a symbol in β€˜*Help*’ buffer.

β€˜http’, β€˜https’​

Web links.

β€˜id’​

Link to a specific headline by its ID property, in an Org file.

β€˜info’​

Link to an Info manual, or to a specific node.

β€˜irc’​

Link to an IRC channel.

β€˜mailto’​

Link to message composition.

β€˜news’​

Usenet links.

β€˜shell’​

Execute a shell command upon activation.

The following table illustrates the link types above, along with their options:

Link TypeExample
httpβ€˜http://staff.science.uva.nl/c.dominik/’
httpsβ€˜https://orgmode.org/’
doiβ€˜doi:10.1000/182’
fileβ€˜file:/home/dominik/images/jupiter.jpg’
β€˜/home/dominik/images/jupiter.jpg’ (same as above)
β€˜file:papers/last.pdf’
β€˜./papers/last.pdf’ (same as above)
β€˜file:/ssh:me@some.where:papers/last.pdf’ (remote)
β€˜/ssh:me@some.where:papers/last.pdf’ (same as above)
β€˜file:sometextfile::NNN’ (jump to line number)
β€˜file:projects.org’
β€˜file:projects.org::some words’ (text search)1
β€˜file:projects.org::*task title’ (headline search)
β€˜file:projects.org::#custom-id’ (headline search)
attachmentβ€˜attachment:projects.org’
β€˜attachment:projects.org::some words’ (text search)
docviewβ€˜docview:papers/last.pdf::NNN’
idβ€˜id:B7423F4D-2E8A-471B-8810-C40F074717E9’
newsβ€˜news:comp.emacs’
mailtoβ€˜mailto:adent@galaxy.net’
mheβ€˜mhe:folder’ (folder link)
β€˜mhe:folder#id’ (message link)
rmailβ€˜rmail:folder’ (folder link)
β€˜rmail:folder#id’ (message link)
gnusβ€˜gnus:group’ (group link)
β€˜gnus:group#id’ (article link)
bbdbβ€˜bbdb:R.*Stallman’ (record with regexp)
ircβ€˜irc:/irc.com/#emacs/bob’
helpβ€˜help:org-store-link’
infoβ€˜info:org#External links’
shellβ€˜shell:ls *.org’
elispβ€˜elisp:(find-file "Elisp.org")’ (Elisp form to evaluate)
β€˜elisp:org-agenda’ (interactive Elisp command)

On top of these built-in link types, additional ones are available through the β€˜contrib/’ directory (see Installation). For example, these links to VM or Wanderlust messages are available when you load the corresponding libraries from the β€˜contrib/’ directory:

β€˜vm:folder’VM folder link
β€˜vm:folder#id’VM message link
β€˜vm://myself@some.where.org/folder#id’VM on remote machine
β€˜vm-imap:account:folder’VM IMAP folder link
β€˜vm-imap:account:folder#id’VM IMAP message link
β€˜wl:folder’Wanderlust folder link
β€˜wl:folder#id’Wanderlust message link

For information on customizing Org to add new link types, see Adding Hyperlink Types.

A link should be enclosed in double brackets and may contain descriptive text to be displayed instead of the URL (see Link Format), for example:

[[http://www.gnu.org/software/emacs/][GNU Emacs]]

If the description is a file name or URL that points to an image, HTML export (see HTML Export) inlines the image as a clickable button. If there is no description at all and the link points to an image, that image is inlined into the exported HTML file.

Org also recognizes external links amid normal text and activates them as links. If spaces must be part of the link (for example in β€˜bbdb:R.*Stallman’), or if you need to remove ambiguities about the end of the link, enclose the link in square or angular brackets.


  1. The actual behavior of the search depends on the value of the variable org-link-search-must-match-exact-headline. If its value is nil, then a fuzzy text search is done. If it is t, then only the exact headline is matched, ignoring spaces and statistic cookies. If the value is query-to-create, then an exact headline is searched; if it is not found, then the user is queried to create it.↩