Three approaches exist for trimming old SharePoint version history: native library settings, PnP PowerShell scripting, and a dedicated GUI tool. Each suits a different situation - here is how they compare.
| Criteria | SharePoint Built-in | PnP PowerShell | ShareMaster Space Master |
|---|---|---|---|
| Deletes existing old versions retroactively | No (future files only) | Yes | Yes |
| Works across multiple libraries | One at a time | Yes (scripted loop) | Yes (multi-select GUI) |
| Scripting required | No | Yes | No |
| Preview storage reclaim before running | No | Manual only | Yes |
| Handles throttling automatically | N/A | Manual rate-limiting needed | Yes (built-in) |
| Admin skill level required | Low | Medium to high | Low |
Method 1: SharePoint's Built-in Version Settings
Every SharePoint document library has a version settings page, accessible via Library Settings. You can set the maximum number of major versions to retain and whether minor (draft) versions are kept. It is where most admins start - quick to configure, no scripting required.
What it does: Changing the version limit applies to new versions going forward. SharePoint does not retroactively delete existing versions when you lower the limit; it only prevents new versions from exceeding the cap. A library with 200 existing versions per file and a new cap of 50 will still hold 200 versions per file until each document is edited again and old versions naturally roll off the end of the queue.
What it does not do: It will not reclaim the storage consumed by existing version history. If your goal is to free up quota today, changing library settings alone will have no visible effect, particularly in read-heavy libraries where files are rarely edited and versions never naturally purge.
Best for
- New tenants setting version governance before accumulation begins
- A single library where waiting for natural rolloff is acceptable
- Admins with no PowerShell experience and no third-party tools available
Method 2: PnP PowerShell
PnP PowerShell is the standard scripting toolkit for SharePoint Online administration. With the right cmdlets, you can iterate through every version of every file in a library and delete any version beyond a threshold you define.
The core approach: use Get-PnPListItem to retrieve items, then access the Versions collection for each item, and call the version delete API on each entry you want to remove. A complete production implementation also needs rate-limiting to avoid SharePoint's request throttle, error handling for checked-out files, pagination for libraries with tens of thousands of items, and logging for audit purposes.
For a 50,000-file library, that script typically runs to 100–200 lines of PowerShell, takes several hours to develop and test, and may need restarting if SharePoint throttles the operation partway through a long run.
"I spent two days getting the PnP script right, then another day watching it process our largest library. It worked, but I would not want to repeat that every cleanup cycle." - SharePoint admin at a logistics company
Best for
- Admins comfortable with PowerShell who need very fine-grained control over what is kept
- Custom trim rules: keep versions by date range rather than count, or filter by file type
- Environments where deploying third-party tools requires a lengthy software approval process
Method 3: ShareMaster Space Master Version Trimmer
ShareMaster's Space Master includes a Version Trimmer that runs as a Windows desktop application. It connects to SharePoint Online using your existing Microsoft 365 credentials and operates entirely through a GUI. No scripts, no module installs, no credential management in code.
The workflow is: open Space Master, connect to the site, select one or more document libraries, set a retention target (for example, keep the 30 most recent major versions per file), review the estimated storage reclaim, then confirm the trim. Processing runs in batches, handles throttling automatically, and does not time out on multi-hour runs - Space Master operates as a desktop application, so there is no browser session to expire.
The preview step is particularly useful when reporting to management. Before running a large trim operation, you can show exactly how many gigabytes will be reclaimed and from which libraries, without yet touching a single file.
Best for
- Admins who need to reclaim storage now, across multiple libraries, without scripting
- One-time cleanup of years of accumulated version history across a large tenant
- Quarterly or annual version trim cycles where rebuilding a PowerShell script each time is impractical
- Teams where not every admin has PowerShell experience but any admin can use a GUI tool
For more detail on Space Master's version and storage tools, see the Version Trimmer product page or the full Space Master feature overview.
Decision Matrix: Which Method Fits Your Situation?
| Your situation | Recommended approach |
|---|---|
| Setting version governance for a new environment before accumulation begins | SharePoint built-in library settings |
| Reclaiming storage from one library immediately, no tool budget | PnP PowerShell |
| Trimming multiple libraries across a large tenant without writing scripts | Space Master Version Trimmer |
| Custom trim rules: keep versions by date range, not just count | PnP PowerShell |
| Non-technical admin running a cleanup on a recurring schedule | Space Master Version Trimmer |
| Need to understand what the default version settings are before changing anything | See the SharePoint versioning defaults reference |
Frequently Asked Questions
Does trimming SharePoint version history delete the current file?
No. Version trimming only removes older historical copies of a file. The current version is always preserved. Trimming version history is a storage optimisation, not a file deletion operation.
How much storage can version cleanup realistically recover?
In active document libraries with the SharePoint default of 500 major versions per file, version history often consumes 2 to 5 times the volume of live file content. Trimming to a limit of 10 to 50 recent versions typically recovers 60 to 85% of version storage in those libraries.
Can I trim version history across multiple libraries at once?
With native SharePoint settings, you can change the version limit going forward but cannot bulk-delete existing versions across libraries without scripting. PnP PowerShell can be scripted to loop across libraries. ShareMaster's Space Master Version Trimmer applies the operation across multiple selected libraries from a Windows GUI, without writing scripts.
Try ShareMaster free for 14 days