This SharePoint tutorial, we will discuss, document Deletion Policies in Office 365 SharePoint Online. What are Document Deletion Policies in Office 365 and how to create document deletion policy as well as how to implement the document deletion policy in a SharePoint site collection?
In lots of enterprises, one common requirement comes as to store documents for a specific period of time and after that, the document should get deleted. SharePoint Online provides this document deletion policy feature which will help to achieve this kind of requirement.
SharePoint Tutorial Contents
It will delete documents from the site after a specific period of time. Not only from the SharePoint site, but it also deletes documents from the user’s OneDrive for Business sites.
Previously SharePoint provides Records management and Information management policies that are helpful to deal with structured data. Document deletion policies help in the automatic deletion of unstructured data such as OneDrive for Business sites and team sites.
Below are a few points we should remember in document deletion policies:
As the name suggest document deletion policies work only for document libraries not with the list.
Three main components of this: Policies, Rules and Site Collections
We can create single or multiple policies. We can add single or multiple rules to a single document deletion policy. And then we can assign a policy to a site collection template (like team site template) or to a single site collection also. When you assign a document deletion policy to a site collection template, then the policy will be available to all site collections created from that template.
Apart from this you can also create a single policy and make it mandatory. Then the policy can be assigned to all sites in the site collection.
Document deletion policies are inherited meaning if a site owner selects a document deletion policy for their site then all the subsites will inherit the policy from the parent. But site owners can anytime break the inheritance and can apply a different policy.
Whenever you apply a document deletion policy, you should remember that the time period depends on the document was created or modified, not the time since the policy was assigned. When you assign the policy for the first time, all documents in the site are evaluated and, if they meet the criteria, they will be deleted. This applies to all existing documents, not just new documents created since the policy was assigned.
Another point to remember is that A site collection or a site collection template can have one or more policies assigned to it, and each of those policies can have one or more rules. But there can be only one policy that can active per site and there can be only one deletion rule that’s active at any time for the libraries within the site. Check a very good fig like below:
There two ways you can create open Document Deletion Policy Center:
From Office 365 Security & Compliance:
Login to your Office 365, then from App launcher click on “Security & Compliance Center”. Then from the left navigation, click on “Data management” and then click on Retention. Then from the Retention, click on “Manage document deletion policies for SharePoint Online and OneDrive for Business”. The first time when you click on this link it will create the Document Deletion Policy Center automatically.
From Create New Site Template:
The other way we can create a Document Deletion Policy Center is Login to Office 365, then go to SharePoint administration. There create a new site collection and then choose “Compliance Policy Center” template which is under the Enterprise tab as shown in the fig below:
Then in the Compliance Policy Center, click on Deletion Policies like below:
This will open the Deletion Policies library which will have two default Policies. Click on New item to create a new policy.
Here in the New Deletion Policy page, give a Policy Name, and Description.
Then click on the +New button to add a new rule to the policy. Here give a name for the rule. Either you can delete an item to recycle bin or you can permanently delete the item. Here I have chosen Delete to Recycle Bin option.
Date from when the document deletion date will be calculated, in this case, choose either Last Modified Date or Created date. Whatever option you will choose, the time period calculation will be done based on this option.
The time period after which the document will be deleted: Here you can add Years, Months or Days. Lets us say if you want to delete documents whose last modified date before 2 months, then you can add 2 in the textbox and then select Months from the drop-down.
Also, you can Set as default rule checkbox to make this rule as a default rule.
Once you Save the rule, the policy will look like below:
Then click on Save to Save the Policy. It will reflect in the Deletion Policies library. You can see now 3 policies.
Now we will assign the policy to a site collection template. So that the Deletion Policy will be available to all site collections created from the same template.
In the Document Deletion Policy Center, click on “Policy Assignment for Templates” link and then click on +new item in “Policy Assignments for Templates” library like below:
Then in the New Template Assignment, first click on “First choose a template” button as shown in the fig below:
Here either you can choose from OneDrive for Business Template or You can choose from Site Collection template. Then I am choosing here for the Team Site template. So any site collection using the Team site template will have this Policy.
Then assign the rule which we have created in the previous steps like below:
Now you will look at the New Template Assignment, the screen looks like below. Where we have chosen the Template, Rule. And also if you want to make this rule as mandatory, then check the checkbox “Make Policy as Mandatory” like below:
Now we will discuss how we can assign Document Deletion Policy to site collections. From the “Document Deletion Policy Center” site, click on “Policy Assignments for Site Collections” link as which will open “Policy Assignments for Site Collections” document library. Here click on +new items as shown in the fig below:
Then in the “New: Site Collection Assignment” page click on “First choose a site collection” link. This will open Choose a site collection dialog box. Here search for your site collection as shown in the fig below:
Then click on OK. Then assign the rule as shown in the fig below, and also if you want to make the policy as mandatory, then check the checkbox “Mark Policy as Mandatory” as shown in the fig below:
Now we can the Policy in the site collection. Go back to your Office 365 SharePoint Online site collection. Click on the gear icon and then click on Site settings. This will open the Site settings page. Click on “Document Deletion Policies” which is under Site Collection Administration.
If you will not be able to see this link, wait till 24 hours, it should be visible. For me, it came in 2 hours. It should look like below:
The SharePoint document policy will appear like below:
You may like following SharePoint tutorials:
- How to create a site or subsite in SharePoint Online?
- Save site as template option missing in SharePoint online
- Bulk SharePoint Online Site Collection Creation using PowerShell
- Get SharePoint Online Site and List Templates using PowerShell
- Confirm SharePoint 2013 Web site in use
- SharePoint 2016 Fast Site Collection Creation using PowerShell
- SharePoint Missing Blank Site Template
- How to display more than 3 views in SharePoint document library
- How to check the description of the Document Library in SharePoint 2013/2016/Online?
- Working with Enterprise Metadata and Keywords Settings for List and Document library in SharePoint Online
- How to configure metadata navigation for a document library in SharePoint Online?
- Different between SharePoint list and Document library
- How to sort folders in SharePoint document library
- Steps to get URL for uploading document to a document library in SharePoint 2013 online
- Configure unique document ids for SharePoint 2013 document library
- How to give unique permissions to list or document library in SharePoint
This tutorial, we learned what is document deletion policy in SharePoint? how to create document deletion policy as well as how to implement the document deletion policy in a SharePoint site collection?
Bhawana Rathore is a Microsoft MVP (3 times in Office Apps & Services) and a passionate SharePoint Consultant, having around 10 years of IT experience in the industry, as well as in .Net technologies. She likes to share her technical expertise in EnjoySharePoint.com and SPGuides.com
Download SharePoint Online Tutorial PDF FREE!
Get update on Webinars, video tutorials, training courses etc.