Deleting Mass Document Versions

Some users of mine have documents in SharePoint that have versioning turned on. Well, there wasn’t ever a limit for these versions so the versions kept piling up and up and up. We have only 19 documents in the document library, but the size of the document library, all in all, is a whopping 6.3 gigs! Ouch! I decided some version deletion was in order. Making use of versions is all fine and dandy, but keeping all the versions from the document’s creation is overkill. So, hmm, I know that you can delete a version one by one, but what about mass deletion of certain versions? I know SharePoint doesn’t handle this OOTB, and picking and choosing which versions I’d like to keep are out of the quesiton….so I did some research.

– I could delete each version one by one. No thanks, too timely.
– I could use a program to do it for me. No thanks, too risky.
– Found SQL Statements that are ran against the content database. No thanks, way too risky!

So I came up with my own method. Did not find it in any other blogs, so I decided to blog about it so I can help anyone else struggling with the issue.

All you do is:

– Make sure you have recycle bin turned on.
– Delete all (I didn’t stutter) major and/or minor versions from the “Version History” page of a file
– Navigate to the Recycle Bin.
– Restore the versions you want to keep! Delete the ones you don’t!
– Viola! You get to pick and choose which versions you delete!

Wasn’t that simple? Make sure you do this one-by-one. This way, you can differentiate the versions of one file with the versions of another file.


8 thoughts on “Deleting Mass Document Versions

  1. Mike, Great Idea… Really helped me save time and effort with versioning control… Truely appreciate you posting this article.

  2. Hi Mike, is it possible to delete the current minor version of a document without having to add everything to the Recycle bin. I have a library of published documents that users are able to create minor versions (drafts) that are then routed through a workflow for approval before they get published as a major version. The problem I have is what happens when a document is rejected. Now the person who created that draft sees the draft as the latest version in the version history. I would like to be able to run a search to find any minor versions that were rejected and delete them so that the only version is the current approved major version.

    It has come to my attention that you can not delete the current minor version through the normal user interface so, do you know another way, or am I missing something?

  3. Great. But I have another requirement! How can I do this mass delete all versions for the entire library, when I am sure that I want to keep only the latest of each document? I have about 500 files
    Any help is appreciated.

  4. If you want to delete all the previous versions without picking and choosing versions to keep, you can tell SharePoint to keep a specific amount of versions in the library settings. You can also use a powershell script to iterate through all the versions and delete the ones that you want gone.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s