I have an org file:

#+TITLE: Hello!

Hello world!

I can perform a "body-only" export of this file to html by issuing C-c C-e C-b h h. Here, the C-b keystroke toggles the "body-only" variable from Off to On.

Is it possible to set the default value of "body-only" for my org file to On? It seems that something like

#+TITLE: Hello!
#+OPTIONS: body-only:t

Hello world!

should work.

  • 3
    It does seem like this should be possible, but from browsing the source (ox.html) it seems like body-only and visible-only are handled separately from other org options, and I can't see an obvious way to make this work.
    – amitp
    Jan 8, 2018 at 19:33

1 Answer 1


You can set org-export-body-only to t either globally or in a file-local variable section. Globally, add this to your init file:

(setq org-export-body-only t)

In an Org mode file, add a file-local variable section at the end of the file:

Org mode file

*  File-local variables                                        :noexport:
# Local Variables:
# org-export-body-only: t
# End:

Either of these will result in Body only being on when you export.

The other settings in the top section of the export dispatcher can similarly be controlled. The corresponding variable names are

  • org-export-visible-only
  • org-export-in-background
  • org-export-force-publishing
  • org-export-initial-scope

The first three can be set to t (they are nil by default). The last one needs to be set to either of the symbols buffer (the default) or subtree. The symbol should not be quoted in a file-local variable section (but of course it needs to be quoted if you setq in your init file). So toggling them all from their defaults can be done with the following file-local variable section:

* Local Variables                                               :noexport:
# Local Variables:
# org-export-body-only: t
# org-export-visible-only: t
# org-export-force-publishing: t
# org-export-in-background: t
# org-export-initial-scope: subtree
# End:

N.B. This set of customizations was added on 2023-04-14 with commit 9d06e7bf80056. Back in 2017, when the question was asked, only org-export-initial-scope and org-export-in-background existed. The change is NOT available in any 9.6.x release. It will be available with release 9.7 but if you want it now, you'll need to get the current upstream tree from the Git repo.

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.