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 Option 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 Option Inspector

Access the Option Inspector from the menu with Format Option Inspector... or with the keyboard shortcut :

In the selection drop-down menu, choose Selected Notebook:

  • Make sure the Option Inspector is for the correct notebook. You can use the selection drop-down 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: