Exporting Org files with broken links

Given an Org file with a broken link:

This is a broken link!

When exporting this file through the export dispatcher or a publish project, publishing this file produces an error explaining that the file can’t be exported because it includes a broken link:

Publishing file example.org using ‘org-html-publish-to-html’
org-export-data: Unable to resolve link: "does-not-exist"

You can disable this error and export the file regardless of broken links by setting org-export-with-broken-links:

(setq org-export-with-broken-links t)

Now, generating the file produces an HTML page with the following contents:

<p>
This is !
</p>

Instead of generating with the broken link included—which is what you might expect to happen in this situation1—Org produced a file that has the link stripped out of the document completely.

Another option is “mark”, to clearly mark each broken link in the exported document:

(setq org-export-with-broken-links 'mark)

The result includes the link description in brackets, with the words “broken link” in all caps, to make the problem easier to spot:

<p>
This is [BROKEN LINK: does-not-exist]!
</p>