How to Delete Existing SharePoint File Versions Older Than Six Months
Question details
The user needs a method to bulk delete existing file versions in SharePoint that are older than six months.

- Product
- SharePoint Online
- Device & OS
- not provided
- Scenario
- An organization has implemented a new version expiration policy to retain file versions for six months, but requires a way to retrospectively remove old, existing document versions that currently occupy storage.
- Observed behavior
- While the retention policy handles new versions, the existing versions created before the policy enforcement remain in the system and require administrative intervention to be removed.
Ensure that you have SharePoint Administrator privileges, have the latest SharePoint Online Management Shell installed, and that your tenant has access to the version history controls preview.
Use SharePoint Online PowerShell for Batch Deletion
Execute a batch deletion job via PowerShell to automatically identify and delete all file versions older than 180 days across a specified SharePoint site.
While there is no general built-in GUI option for this specific retrospective cleanup, Microsoft provides PowerShell cmdlets for tenants participating in the version history controls preview.
Using the batch delete job ensures the operation runs efficiently on the backend without requiring manual intervention for individual files.
Launch the SharePoint Online Management Shell on your computer with Administrator privileges.
Run the command 'Connect-SPOService -Url https://yourtenant-admin.sharepoint.com' and authenticate with your global or SharePoint admin credentials.
Execute 'New-SPOSiteFileVersionBatchDeleteJob -Identity https://yourtenant.sharepoint.com/sites/yoursite -DeleteOlderThanDays 180' to initiate the removal of versions older than six months.
Check the status of your deletion job by running 'Get-SPOSiteFileVersionBatchDeleteJob -Identity https://yourtenant.sharepoint.com/sites/yoursite'.

Looking for a Simpler Way to Manage File Versions? Try WPS Office
Managing complex SharePoint server scripts and version controls can be overwhelming. WPS Office provides a free, lightweight, and user-friendly alternative with an intuitive cloud-based version history system that requires zero coding or administrative PowerShell scripts.
- 1. Download and Install: Download WPS Office for free and install it on your device.
- 2. Save to WPS Cloud: Create or open a document and save it directly to your WPS Cloud space.
- 3. Manage Versions Visually: Click on 'History' from the top menu to visually preview, manage, or restore past versions without typing any commands.

Frequently Asked Questions
Why didn't my new 6-month version expiration policy delete existing old versions automatically?
SharePoint expiration policies primarily dictate the retention limits for versions moving forward. To clean up existing file versions that pre-date the policy application, a retrospective batch deletion process is often necessary.
Can I recover the document versions deleted by the PowerShell batch job?
Generally, versions removed using the batch delete job are permanently deleted to free up storage space and bypass the standard site recycle bin. Always ensure you have appropriate backups before running deletion scripts.
Is there a way to bulk delete existing SharePoint versions without using PowerShell?
Currently, SharePoint Online does not offer a native Graphical User Interface (GUI) button to mass-delete historic versions across an entire site. PowerShell remains the Microsoft-recommended method for bulk administrative storage management.
What permissions are required to run SPOSiteFileVersionBatchDeleteJob?
You must hold SharePoint Administrator or Global Administrator privileges within your Microsoft 365 tenant to successfully connect to SPOService and execute batch deletion jobs.




