This is the official manual for the latest Org-mode release.
Org can flexibly export just the code from the code blocks, just the
results of evaluation of the code block, both the code and the
results of the code block evaluation, or none. Org defaults to
exporting code for most languages. For some languages, such as
ditaa, Org defaults to results. To export just the body of
code blocks, see Literal examples. To selectively export sub-trees of
an Org document, see Exporting.
:exports header arguments control exporting code blocks only and
not inline code:
To stop Org from evaluating code blocks during export, set
org-export-babel-evaluate variable to
Turning off evaluation comes in handy when batch processing. For example,
markup languages for wikis, which have a high risk of untrusted code.
Stopping code block evaluation also stops evaluation of all header arguments
of the code block. This may not be desirable in some circumstances. So
during export, to allow evaluation of just the header arguments but not any
code evaluation in the source block, set
To evaluate just the inline code blocks, set
inline-only. Isolating the option to allow inline evaluations
separate from ‘src’ code block evaluations during exports is not for
security but for avoiding any delays due to recalculations, such as calls to
a remote database.
Org never evaluates code blocks in commented sub-trees when exporting (see Comment lines). On the other hand, Org does evaluate code blocks in sub-trees excluded from export (see Export settings).