SharePoint storage

How to trim versions to increase available SharePoint storage

Learn how to free up valuable SharePoint storage space by finding, reporting on, reviewing and bulk deleting unnecessary versions of large files.
Scott Ortlepp
Updated
September 3, 2025
5 min to read

TLDR

  • Versions can consume a large percentage of the storage on the average tenant.
  • Switching on automated version limiting (or manually limiting to a specific number) only affects new libraries, existing libraries need to be cleaned up if you want to save storage.
  • Versions can be trimmed from individual files or libraries with PowerShell, but it requires a degree of technical knowledge and input time.
  • SProbot can trim versions easily and quickly at scale with no technical expertise needed.

Requirements

Roles & Licensing

  • SharePoint Administrator – Setting org-wide settings via PowerShell and via the SharePoint admin center.
  • M365 Business or Enterprise License – Any Microsoft Business or Enterprise license that includes SharePoint P1 or P2.

Apps & Modules – Update setting via PowerShell

  • PowerShell – There are several versions and ways to access PowerShell, in our guide we will use PowerShell ISE.
  • PnP PowerShell module – This module is used to report on and delete the file versions. You will need the latest version installed and authorized for your user.

What is versioning?

Versioning in SharePoint is the automatic creation of a new copy of a file each time the file is edited. Each copy is considered a version and is stored within the original file. This enables users to track, manage and restore previous version of files stored within OneDrive and SharePoint.

The default number of versions stored in a SharePoint Online document library is 500.

Why do versions consume so much storage?

Versioning doesn't just store incremental changes - it generates a complete duplicate with every save.

This results in consistent storage growth regardless of whether the actual content modifications are minor or substantial between versions.

Consider a PPTX file that weighs in at 120MB for version 1. When a few high-resolution videos are embedded in version 2, the file balloons to 2.2GB. From that point forward, the marketing team only makes small adjustments and annotation updates - no new videos.

You might expect the storage impact to increase modestly from 2.2GB to perhaps 2.5GB over subsequent edits, but since each version produces a complete replica, every single save operation consumes another 2.2GB of space. With a team of 6 marketers making revisions twice weekly, this single file can exceed 1TB of storage consumption within 12 months!

How to prevent exorbitant version creation

SharePoint enables setup of automated version limits which uses an algorithmic approach to determine how many versions are reasonable for the specific library. Read more in our article How to save SharePoint storage with automated versioning.

What's the catch?

When configuring version history limits at a tenant level, only new SharePoint libraries will inherit the settings by default. Existing libraries are not affected by the tenant level changes.

This means if you want to free up storage space on existing SharePoint sites, you’ll need to roll up your sleeves and eliminate unnecessary versions. To do this manually would be far too labor intensive and prone to error. Below are ways to perform this cleanup in bulk.

How to trim versions in bulk

Method 1 – PnP PowerShell

To be able to report on and trim versions using PnP PowerShell, you will need to ensure the following:

  1. Access – The account performing the reporting and trimming will need to have a minimum of Member level access to the SharePoint site.
  2. Enable the Adding and Customize Pages – The site that where the library is hosted, the property on the site that the library is hosted the DenyAddAndCustomizePages property needs to be set to $false.

Step 1- Report on a file and its versions

To report on a file and its versions use the following command:

Get-PnPFileVersion -URL <File URL example: /shared documents/document.docx>

For a full report for your library, download the PowerShell script: Report on File Versions.ps1

Step 2 - Trim file versions

To trim file specific file versions use the following command:

Remove-PnPFileVersion -URL <File URL example: /shared documents/document.docx> -Id <Version ID>

*Note: This will remove a single version at a time and only move it to the recycle bin. If you want to skip the confirmation prompt and recycle bin, add the following at the end of the line:

-Recycle:$false -Force

To bulk trim file versions in a library, download the PowerShell script: Bulk trim File Versions.ps1. The list of versions to be trimmed will be the reviewed output file from the Report on File Versions.ps1 script.

Advantages

  • Bulk actions – You are able to report on and trim versions in bulk.

Disadvantages

  • Manual Reporting – Each list you want to report on, you will need to have the details of.
  • Reports – The CSV reports generated are not user friendly and may cause issues when confirming the files and versions that need to be trimmed.
  • Time Intensive – Using the bulk PowerShell scripts is quicker than manually trimming versions but is still time intensive.
  • Technical – Requires someone with technical skills to perform the reporting and version trimming.

Method 2 – SProbot

Using the SProbot Large files cleanup tool enables you to easily create customizable reports per workspace within your tenant. Once completed, you can action items directly in the report and instantly free up space in your tenant.

Step 1 - Run a large file report

To generate a large file report:

  1. Open the Cleanup tab in SProbot and search for a site or team you want to action.
  2. Browse to the site or team's Content tab and select Large files in the report dropdown.
  3. Set the report parameters:
    • Choose a minimum file size (50MB–1GB).
    • Select a last modified date range (from 3 months to 1 year ago, or any time).
  4. Run the report.

SProbot will start reviewing the site for large files and generate a report for your parameters. Depending on the size of a site, this may take a few minutes. You'll be notified when it's ready.

Once completed, you’ll see a report that looks like this:

In this example, the combined size of the latest versions of files over 100MB is 24.81GB, but the sized of all versions is 682.32GB. By keeping only the latest version of all these files, you can immediately free up more than 650GB of storage.

Step 2 - Trim versions

To trim versions for one or more files:

  1. Select the file(s) you want to trim versions for.
  2. Select Cleanup and the number of versions to keep.
  3. Confirm the number of versions you want to keep and that all others will be permanently deleted by typing in DELETE and then pressing the Delete button.

Your trimming action will be added to the queue and processed, and you can always go back to Reports > Activity history and view an audit trail of all previous trims.

* Note: Trimmed versions are not sent to the recycle bin, they are permanently deleted to make additional storage immediately available.

*Also note: You can alternately choose to delete the file entirely.

Step 2.1 - Trim versions of multiple files

To trim versions for multiple files, simply select the files you want to trim (or all files in the site) and follow the same steps as before.

Advantages of version trimming with SProbot

  • Report filters – The report filters target only the largest files within a site to maximise the impact.
  • Bulk actions – You are able to report on and trim versions in bulk, even targeting all files across all libraries in a site, its subsites and private/shared channel sites.
  • User Interface – The user interface is easy to use and gives unique insights into which files are using the most storage.
  • Quick Actions – Quickly action unneeded versions.
  • Downloadable – Download a detailed report which can be used to identify files before actioning them.
Need to reduce SharePoint storage costs?
Use SProbot to find and deal with redundant, obsolete and trivial content on your tenant
Need help with your SharePoint project?
We have helped organisations optimise their use of SharePoint since 2003
Get useful SharePoint and Teams insights first

See how SProbot can help you cut operational costs

We'll show you how to save on storage, tame content sprawl, and improve security.

Get a demo