How to set site closure and deletion policies in SharePoint Online
We have all been there – you go and do an inventory of your SharePoint environment, and you make it to the subsites that have last been touched by humans five years ago. Moreover, the site owner has left the company, and no one knows what the site is for and what kind of content is there. To avoid such trivial situations, it is wise to have a company-wide governance plan. One element of the governance plan could be the site retention policy. The good news is that it can be automated within SharePoint with the help of site closure and deletion policies. This post explains how to do this.
By default, sites are never automatically deleted and are retained forever, unless a custom site policy has been created.
Step 1: Create a custom site policy
- Gear Icon > Site Policies (under Site Collection Administration)
- Hit Create
- By default, Do not close or delete site automatically is selected. To create a custom policy, choose one of the other radio buttons. In the example below, I created a policy that automatically deletes sites that have been manually closed by the user 12 months after the site closed date. You can also close and delete sites automatically.
- Once you create conditions/triggers for a policy, click OK
Step 2: Apply a custom site policy to a site
- Once you have created a site policy at the site collection level, you now need to apply it manually to each subsite. To do this, go to the subsite you want to apply the policy to, then Gear Icon > Site Settings > Site Closure and Deletion (under Site Administration)
- Under Site Policy, choose the policy you just created from the drop-down menu. Click OK
- Due to the specific policy we created, we are waiting for site owner to close the site first. To do this, go to the Site Closure and Deletion and press Close this site now button. Two things will occur in our case. #1 – the site and its contents will “disappear” from SharePoint, and #2 – specific to our policy, a 12-month deletion policy will be triggered, and the clock will start ticking from the site closure date
- You can always go back and open the site again or even postpone the site deletion if you wish – as shown below.
Step 3: Warnings and Notifications
Once the site is close to the deletion date by means of the policy you set up above, you will constantly be reminded about that fact. First, if you log in to the site, you will see a notification message appearing on the top.
Second, the Site Collection Admin will get an email like the one below with the warning.