# Org HTML Export With No Additional Divs

As you're all probably aware, when you export a document from Org mode to HTML, the resulting file contains extra <div> and </div> items around each heading. In some cases these are very helpful, but is there a way to optionally exclude these additional HTML elements for a cleaner output?

• You could use HTML tidy with the --merge-divs option to post-process your html. May 5 at 23:53

You can use ox-slimhtml, an alternative HTML exporter. It produces minimalistic HTML output and in particular does not wrap each heading in a div.

• Thank you for alerting me to this package. It comes very close to answering my question, but unfortunately creates some of its own issues. For example, it seems to wrap the whole output in its own div, even on a body only export. Very interesting though, thank you. May 4 at 18:20

advice is the magic to solve many Emacs problems,

(defun my-org-export-as-hack (orig-func &rest args)
(let* ((result (apply orig-func args))
(backend (nth 0 args)))
(when (eq backend 'html)
;; use replace-regexp-in-string' to process exported result
(message "result=%s" result))
result))
`