I need to add rel=nofollow for every link in my document but be able to change it using something like: #+ATTR_HTML: :rel index,follow. Any ideas?

1 Answer 1


You can alter the behavior of the org-html--anchor function so that no-follow is the default. A simple example:

(define-advice org-html--anchor (:around (orig-func id desc attributes info))
  (funcall orig-func id desc (concat " rel=\"no-follow\"" attributes) info))

Note that this isn't fully complete; when you specify your own value for the rel attribute, you'll end up with both.

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.