Wondering how to set retention policy in SharePoint Online? Whether you’re an IT admin or just getting started with Microsoft 365 compliance tools, we will walk you through the entire procedure of applying the retention policy for SharePoint Online step-by-step.
If you’re new to the platform, first go through this beginner’s guide to learn more about: What is SharePoint Online?
What is the SharePoint Online Retention Policy?
A retention policy is a rule that determines how long content is stored and what happens when that time expires. You can use it to:
- Keep content for a specified period
- Automatically delete content after that time
- Prevent users from deleting or editing documents during the retention period
If you’re unsure how to set retention policy in SharePoint Online, don’t worry—we’ll explain you in this comprehensive guide.
There are two primary types of retention policies:
- Static Retention Policies – Help to set the retention period for all data.
- Adaptive Retention Policies – Help to automatically change the retention period depending on different conditions.
These policies are managed through the Microsoft Purview Compliance Center and can be applied across SharePoint, OneDrive, Teams, and Exchange.
How to Set Retention Policy in SharePoint Online: Types of Retention Policies!
Retention Option | Description | Best For |
Retention Policy | Broad policy applied across SharePoint sites or mailboxes | Organization-wide rules |
Retention Label | Granular control over individual documents or folders | Legal, financial, or HR data |
Adaptive Policy | Uses conditions to apply retention dynamically | Large organizations with varying rules |
Why Retention Policies are Crucial for SharePoint Management?
Applying a retention policy for SharePoint Online is essential to manage data effectively. Here is how:
- Storage Optimization – Prevent SharePoint from becoming cluttered with outdated content.
- Improved Search Results – Automatically removing expired data keeps search results clean and relevant.
- Business Continuity – Ensures that important files are preserved during staff transitions or organizational changes.
How to Set Retention Policy in SharePoint Online?
Creating retention policies in SharePoint Online is a straightforward procedure via Admin Center and PowerShell. In the following sections, we will explore both options. Let’s start!
Method 1. Create a Retention Policy for SharePoint Online Via the Admin Center
Creating and applying a retention policy in SharePoint Online is easy. Ensure you have all the admin rights or SharePoint Online permissions for proceeding with the task hassle-free. Here’s a step-by-step guide:
- Log in to the Microsoft 365 Compliance Center via the app launcher.
- Go to Data Lifecycle Management > Microsoft 365 > Retention Policies.
- Click “New Retention Policy.”
- Add a name and description.
- Assign to specific administrative units (optional).
- Choose between Static or Adaptive Retention.
- Select locations – e.g., SharePoint, OneDrive, Teams.
- Set the duration (e.g., 365 days or 5 years).
- Choose whether to retain, delete, or retain then delete.
- Review your settings and click Submit to create a retention policy for SharePoint Online.
Note: It may take up to 7 days for policies to take effect across your environment.
Method 2. Setting SharePoint Online Retention Policy via PowerShell
Those who looking for how to set retention policy in Sharepoint Online across the organization simultaneously can opt for PowerShell. Before starting with the procedure, ensure that the Security & Compliance PowerShell module is installed and you have proper admin permissions. Additionally, update SharePoint Online Management Shell, if not updated. When everything is set, start running these commands:
Try { Connect-IPPSSession $NewPolicy = New-RetentionCompliancePolicy ` -Name "SharePoint Retention Policy" ` -Comment "Policy for SharePoint Data Retention" ` -SharePointLocation All ` -OneDriveLocation All ` -ModernGroupLocation All ` -Enabled $True New-RetentionComplianceRule ` -Name "Retention Policy Rule" ` -Policy $NewPolicy.Id ` -RetentionDuration 365 ` -RetentionComplianceAction KeepAndDelete ` -ExpirationDateOption ModificationAgeInDays } Catch { write-host "Error: $($_.Exception.Message)" -foregroundcolor Red }
What Are Retention Labels in SharePoint Online?
Retention labels are more granular than policies. They let you apply retention settings to individual documents, emails, or folders.
Feature | Retention Policy | Retention Label |
Scope | Entire site/mailbox | Individual files/folders |
Manual Application | ❌ | ✅ |
Auto-Apply Based on Conditions | ✅ | ✅ |
Record Declaration | ❌ | ✅ |
Use labels when you need document-level control or legal holds for specific types of records.
Impact of Retention Policies on SharePoint Sites
Now you have learned how to set retention policy in Sharepoint Online but implementing a retention policy introduces several key effects:
- Inability to Delete Sites – A SharePoint site that has a retention policy applied to it cannot be erased unless the policy is changed or removed. An error message will appear if the site is attempted to be deleted.
- Restrictions on Deleting Non-Empty Folders – Until the items inside a folder go beyond the retention policy timeframe, the folder cannot be removed.
- Preservation Hold Library – To ensure that no data is permanently destroyed before its retention period is finished, deleted items are moved to a Preservation Hold Library and stored there until their retention period has expired. After expiration, items are removed by the system.
How Retention Works Behind the Scenes?
If you’re exploring how to set retention policy in SharePoint Online, it’s just as important to understand how it functions once applied. A SharePoint retention policy deletes data or sites automatically after the retention period is over. Here is a simple way through which this procedure operates:
- Items stay in SharePoint until the retention timer expires.
- When auto-deleted, they appear in the Recycle Bin, showing “Deleted By: System Account.
- SharePoint runs background cleanup jobs every 30 days to check for expired content.
What Happens After Data Deletion?
Once data is removed as per the SharePoint Online retention policy, you cannot restore it. This is why many SharePoint administrators prefer to use automated tools to:
- Backup SharePoint Online
- Migrate data to another tenant (e.g., during mergers)
- Avoid accidental loss during restructuring
One of the most reliable solutions is SharePoint Migrator which helps to create copies of essential data into another tenant. However, this procedure is also known as SharePoint tenant to tenant migration. You can simply download this tool from the below download button and start using this tool to avoid the data loss situation.
Final Thoughts!
Understanding what is the retention policy for SharePoint Online, is crucial for effective management of data, and avoiding data loss. After this discussion, we have a clear answer to this query and related i.e. how to set retention Policy in SharePoint Online. Additionally, it is necessary to review SharePoint Online retention policy regularly using PowerShell or the Admin Center. You can learn more from Microsoft’s official retention policy documentation.
FAQ – Retention Policy in SharePoint Online
Q1: Can I use both retention labels and policies together?
A: Yes. If both are applied, the longer retention period takes priority.
Q2: How long does it take for a new policy to apply?
A: Up to 7 days across all services in Microsoft 365.
Q3: Can I remove a site under the retention policy?
A: No, not until the policy expires or is removed.
Q4: Do retention labels support versioning?
A: Yes, retention applies to all document versions.