Skip to main content
< All Articles

How to delete content from SharePoint Sites using Retention Policies and Retention Labels

Posted on July 23, 2024
SharePoint

Most of my articles about retention were related to the ability to retain content or prevent its modification and deletion for some time. However, there might also be a need to delete old/outdated content from a SharePoint site. For example, you migrated from file shares to SharePoint Online and would like to delete documents created or modified more than ten years ago. Or, you might have a legal or regulatory requirement to delete all documents created over a year ago. Luckily, in those cases, you can set up your retention policies to find/identify and delete such content based on the retention settings. Let me explain how this works.

Two ways to delete old content from a site using the retention policies

Just like with retention and records management, there are two ways for you to get rid of the outdated content on your SharePoint sites:

Let me describe both options below.

How to delete content from SharePoint Site using Retention Policies

When you want to apply a blanket policy to delete content on the entire site, you can rely on the Site Retention Policy to delete content. Here are the steps.

    1. From the Microsoft 365 App Launcher, click on ComplianceDeletecontentretentionpolicieslabels1
    2. Under Solutions, click on Data lifecycle management > Microsoft 365.Deletecontentretentionpolicieslabels2
    3. Once in the Data lifecycle management dashboard, click on Retention policies > New retention policydelete content from SharePoint Site using Retention Policies and Retention Labels
    4. Give your policy a name, click NextDeletecontentretentionpolicieslabels4
    5. On the next screen, you can choose Admin Units. For this post, click Next, but if you want to learn more about this functionality, click here.Deletecontentretentionpolicieslabels5
    6. On the next screen, you have to choose the policy type you want to create: Adaptive or Static. I explained the difference in this article. For this exercise, I am going to choose Static. Click Next.Deletecontentretentionpolicieslabels6
    7. Choose the site(s) to which you would like to apply the policies, and click Done.Deletecontentretentionpolicieslabels7
    8. Click Next to proceed to the next screen.Deletecontentretentionpolicieslabels8
    9. On the next screen, you have to specify the retention settings. We are deleting items, not retaining them, so choose Only delete items when they reach a certain age. In my case, I am deleting documents once they have not been modified for the 2 days. Realistically, you might want to set a much higher limit.Deletecontentretentionpolicieslabels9
    10. On the next screen, review the setup and click Submit to create and publish the policy. Note the warning message about items to be deleted.delete content from SharePoint Site using Retention Policies and Retention Labels
    11. You will then receive a confirmation message.Deletecontentretentionpolicieslabels11

What happens when the Site Deletion Policy takes effect?

  1. The policy took effect within less than 24 hours, and I ended up with a much cleaner document library. The below screenshot shows the library before the Site Deletion Policy was applied.Deletecontentretentionpolicieslabels12
  2. And here is the same library after the Site Deletion Policy was applied.Deletecontentretentionpolicieslabels13
  3. All the deleted documents went straight to the Recycle Bin.Deletecontentretentionpolicieslabels15

How to delete content from SharePoint Site using Label Retention Policies

Just like you can delete old content using the Site-level policies, you can do so using the label retention policies – by applying the label to individual items.

    1. From the Data lifecycle management, click on the Labels tab, then Create a labelDeletecontentretentionpolicieslabels16
    2. Give your retention label a name/description, and click Next.delete content from SharePoint Site using Retention Policies and Retention Labels
    3. Choose the middle option: Enforce actions after a specific period, click Next.delete content from SharePoint Site using Retention Policies and Retention Labels
    4. On the next screen, define the period and when it should begin. In my case, I am just setting up 2 days so we can easily test. Click Next.Deletecontentretentionpolicieslabels19
    5. Next, choose what will happen after the period expires. In our case, we want to choose: Delete items automatically.delete content from SharePoint Site using Retention Policies and Retention Labels
    6. Next, review the settings and click Create label.Deletecontentretentionpolicieslabels21
    7. On the next screen, you will get a confirmation and recommendation to publish the labelDeletecontentretentionpolicieslabels22
    8. Click Done to proceed and publish the label to SharePoint Site(s).Deletecontentretentionpolicieslabels23
    9. Click Next.delete content from SharePoint Site using Retention Policies and Retention Labels
    10. Click Next to skip Admin Units, which I explained above.Deletecontentretentionpolicieslabels25
    11. For this article, choose Static. Click Next.Deletecontentretentionpolicieslabels26
    12. Just like with the Site Retention Policy above, choose a specific site(s) to publish the label to. Click Next.Deletecontentretentionpolicieslabels27
    13. Give your policy a name, and click Next.Deletecontentretentionpolicieslabels28
    14. On the final screen, review the settings and click Submit to publish the label.Deletecontentretentionpolicieslabels29
    15. You will then receive a confirmation message.Deletecontentretentionpolicieslabels30

What happens when the Label Retention (Deletion) Policy takes effect?

  1. After the label is published, you will be able to tag items with the label.Deletecontentretentionpolicieslabels32
  2. In my case, I am tagging 4 documents within a librarydelete content from SharePoint Site using Retention Policies and Retention Labels
  3. After a few days, those labeled documents are removed from the library (due to deletion policy)Deletecontentretentionpolicieslabels34
  4. And the labeled documents end up in the Recycle Bin, per the policy.Deletecontentretentionpolicieslabels33

About Me

I’m Greg Zelfond, a U.S. based SharePoint consultant, and I provide affordable out-of-the-box SharePoint consulting, training, and configuration assistance to small and medium-sized businesses all over the world.

Need help?