Call this command when the point is anywhere after the first
[[ brackets of an org-link (or anywhere on/after an hyper-linked org-link).
An org link will be deleted if it is of the format
[[LINK]] in an
org-mode buffer; else nothing will happen.
For safety, the discarded LINK from org-link is saved to the
kill-ring in the event a need arises to use that link elsewhere.
(defun my/org-delete-link ()
"Replace an org link of the format [[LINK][DESCRIPTION]] with DESCRIPTION.
If the link is of the format [[LINK]], delete the whole org link.
In both the cases, save the LINK to the kill-ring.
Execute this command while the point is on or after the hyper-linked org link."
(when (derived-mode-p 'org-mode)
(let ((search-invisible t) start end)
(when (re-search-backward "\\[\\[" nil :noerror)
(when (re-search-forward "\\[\\[\\(.*?\\)\\(\\]\\[.*?\\)*\\]\\]" nil :noerror)
(setq start (match-beginning 0))
(setq end (match-end 0))
(kill-new (match-string-no-properties 1)) ; Save the link to kill-ring
(replace-regexp "\\[\\[.*?\\(\\]\\[\\(.*?\\)\\)*\\]\\]" "\\2" nil start end)))))))