OS X Versions Cleaner
A script that scrubs the document version history from OS X systems.
Warning: This script deletes all previous versions of all documents for all applications that use OS X document versioning. Please understand what you are doing and confirm that you do not need prior versions before you use this script. A Time Machine backup is highly recommended prior to use.
It does not delete the current versions of these documents.
The OS X Versions feature provides an automatic document versioning tool that allows you to recover up to hundreds of prior document changes in commonly used applications such as Pages, Preview, Numbers, as well as in many third party applications. Not all users require this feature and in certain cases it leads to the loss of a significant amount of storage space on your system (hundreds of GB). This feature was introduced in OS X Lion and Apple documentation is available here.
This script eliminates all stored document versions from your Mac OSX v 10.7+ system (OSX Lion through current).
Requires Python v2.x or v3.x
Get the Script
or pull the repository to your machine with git:
git clone https://github.com/chrissimpkins/macosx-versions-cleaner.git
Navigate to the
version_cleaner.py file in the repository and execute the command:
sudo python version_cleaner.py
The script will ask if you would like to reboot to complete the cleanup process. Enter
If you choose not to reboot your system, you will not be able to save document versions in applications that use them until you perform a manual reboot.
Discontinue Future Versioning in Applications
Use the following command in your terminal application:
defaults write -app ‘<appname>’ ApplePersistence -bool no
<appname> with the application that uses the Versions feature.
You can safely delete the entire OS X Versions Cleaner repository after use. Or, keep it around to use down the road when document versions pile up again.