Setting the variable org-export-babel-evaluate to nil will avoid code evaluation, but it will also cause all source block header arguments to be ignored This means that code blocks with the argument :exports none
or :exports results
will end up in the export. This caught me off guard.
The alternative is to use the header argument :eval no-export
on a file basis and then remove that line when re-running the source code:
#+PROPERTY: HEADER-ARGS+ :eval no-export
See the docstring for org-babel-evaluate:
Switch controlling code evaluation and header processing during export.
When set to nil no code will be evaluated as part of the export
process and no header arguments will be obeyed. Users who wish
to avoid evaluating code on export should use the header argument
‘:eval never-export’.
(add-to-list 'org-babel-default-header-args '(:eval . "never-export"))
– Reid