Forum Discussion
Stop SharePoint document versioning
Hi, I am using the SharePoint library with
Some more columns.
On every edit in columns after uploading a document.
Some tasks are updated with Microsoft Power Automate.
Making the new version of my Document so it is causing a size issue.
How I can stop SharePoint from creating a new version of the document?
I found that SharePoint does not allow this.
I also can not delete all versions in bulk it is allowing one-by-one document.
Please guide and suggest.
- JaredMatfessIron ContributorHi Arif,
I believe you can only accomplish this via PowerShell using the PNP Powershell library. The command you're looking for is Remove-PnPFileVersion.
Please see here for the parameters you would use:
https://pnp.github.io/powershell/cmdlets/Remove-PnPFileVersion.html
Best regards,
-Jared- Arif-KashmireeCopper ContributorThank you dear Jared Matfess for your time
- Don_KirkhamCopper Contributor
Arif-Kashmiree In your post, you asked about turning off versioning. This is possible by turning it off for the library. When you turn it off, it automatically deletes all previous versions, so if you just want to delete all previous versions, but not turn off versioning permanently, you could turn versioning off and then back on.
To turn off versioning:
Go to Library Settings > Versioning Settings
Select No versioning
Click OK
Good luck!
DonIf my answer helps solve or resolve your issue, please consider clicking Mark as Best Response & Like. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it a Like.
- Arif-KashmireeCopper Contributor"Select No versioning" This option no more exist.
- JaredMatfessIron ContributorYou can turn off versioning at the library level also using PNP Powershell:
# Connect to the SharePoint site
Connect-PnPOnline -Url "https://jaredisawesome.sharepoint.com/sites/YourSiteHere/" -UseWebLogin
# Disable versioning for the specific document library
Set-PnPList -Identity "Shared Documents" -EnableVersioning $false