Reduce file size or remove sensitive output data by saving a notebook without output.

Using the menu...

Use this method if you only want to delete output cells once. This is an ad-hoc method.

Open a notebook

Open a notebook with both input and output cells:

Delete all output cells

From the menu, select Cells Delete All Output to remove output cells in the notebook:

Save and close the notebook

Save the notebook, then close the window:

Using the Options Inspector...

Use this method if you want to delete all output cells more than once. This is an automatic method that will occur once you close the notebook window.

Open a notebook

Open a notebook with both input and output cells:

Open the options inspector

Access the options inspector from the menu in Format Options Inspector... or with the keyboard shortcut :

In the selection dropdown menu, choose Selected Notebook:

  • Make sure the options inspector is for the correct notebook. You can use the selection dropdown menu to choose a specific notebook or to edit options globally.

Edit the NotebookEventActions line

Find the NotebookEventActions line under Notebook Options Evaluation Options:

Use FrontEndToken and FrontEndExecute to remove all output and add it to the NotebookEventActions line:

Save and close the notebook

Save the notebook, then close the window:

Programmatically...

Use this method if you want to delete all output cells more than once. This is an automatic method that will occur once you close the notebook window.

Open a notebook

Open a notebook with both input and output cells:

Delete all output cells

Use SetOptions to edit a notebooks NotebookEventActions, with FrontEndTokenExecute to remove all output from the notebook:

Save and close the notebook

Save the notebook, then close the window: