
|
Overview
SharePoint Online’s version history feature is pivotal for tracking document modifications but can inadvertently consume considerable storage space. This guide outlines various methods to delete file versions, including manual methods, library settings, Intelligent Versioning, and PowerShell commands. It also provides a customizable PowerShell script for targeted cleanup by site, library, folder, date range, user, and more. |
Version history is a crucial aspect of document management in SharePoint, enabling users to monitor changes and access previous iterations of files. However, it poses a potential risk of occupying a substantial amount of storage space, often becoming a significant drain on your SharePoint environment. Each version of a document contributes to your overall storage limit, and as versions proliferate across numerous files, they can quickly deplete your available storage.
Without consistent monitoring and cleanup, version history can exhaust your storage capacity, leading to quota notifications or, worse, instances where sites revert to read-only mode. Consequently, automating the cleanup of version history is vital for effective management of storage in SharePoint Online.
This guide aims to provide various methodologies for deleting version history in SharePoint Online.
How to View File Version History in SharePoint?
Before proceeding to delete versions, it’s essential to understand the available versions for each file, including both major and minor versions, and the storage each occupies. Major versions are saved as complete copies, while minor versions also consume space, which can accumulate rapidly even with minimal edits.
This clarity is crucial for making informed decisions regarding cleanup. Without this knowledge, it’s challenging to discern which files are taking up significant storage or to delete versions without risking the loss of important file iterations.
To facilitate this, you can employ our dedicated PowerShell script, which efficiently retrieves file version details. This script is particularly beneficial for Microsoft 365 administrators as it exports version information for all files within SharePoint Online into a detailed CSV report.
Download Script from GitHub: GetFileVersionHistoryReport
Sample Output:
For more in-depth insights into storage management, check out AdminDroid’s SharePoint Storage Explorer, which allows you to visualize storage consumption easily, identify large files and documents with many versions, and make informed decisions.
How to Delete File Versions in SharePoint Online?
Now that we have an understanding of version history, let’s explore the various methods for cleaning up version history in SharePoint Online:
1. Delete Version History Per File in SharePoint
To remove version history from a specific file in SharePoint, follow these steps:
- Access the SharePoint site that holds the file.
- Click the ellipsis (…) next to the file.
- Select Version history. A dialog will appear displaying version details, including version number, modified date, and the user who made the changes.
- Click on the date of the version you wish to delete within the Modified column.
- From the dropdown menu, choose Delete.
You also have the option to select ‘Delete all versions’ or ‘Delete minor versions’ to simultaneously remove multiple versions. However, the latest version of a file cannot be deleted.
While this approach works, it can quickly become tedious, as you must open each file individually and repeat these steps across large sites or libraries, making it impractical for extensive libraries.
2. Delete File Versions at the Document Library Level
To manage version history for all files within a document library, you can adjust the library’s versioning settings. Please follow these steps:
- Go to the document library where you wish to adjust versioning.
- Click on Settings → Library settings.
- Under General Settings, select Versioning settings.
- Set the required version limits:
- Define a Version time limit (including options like No time limit, Automatic, or Manual with specific day parameters).
- Specify a Version count limit (indicating the number of major and draft versions to retain).
- Click OK to save your changes.
Once these settings are in place, older versions will be automatically and irrevocably deleted once they exceed the specified time or count limits…








