Unable to delete empty folder on Sharepoint

Anonymous
2021-07-21T09:17:02+00:00

Unable to delete empty folder on Sharepoint

Error message

you have to delete all the items in this folder before you can delete the folder

Microsoft 365 and Office | SharePoint | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Anonymous
    2021-07-21T13:02:51+00:00

    Hi Ong Yong Siang,

    Welcome to community.

    Per my search, the error message "You have to delete all the items in this folder before you can delete the folder" may be related to the site/library which is on hold.

    For troubleshooting, you may go to Site Contents page

    (https://yourtenant.sharepoint.com/sites/sitename/_layouts/15/viewlsts.aspx?view=14) and see if there is a library called Preservation hold library.

    In the meantime, to check if the site is on hold and if the site is protected by any DLP, I recommend you contact your Microsoft 365 admin and verify it from Microsoft 365 Compliance center.

    For reference: How do I find my Microsoft 365 admin

    1.Let the admin go to Microsoft 365 Compliance center

    2.Go to Policies > Retention > Retention policies, see if there is any retention policy is applied to the site.

    Go to Policies > Data loss prevention > Policies, see if there is any DLP policy is applied to the site.

    Go to eDiscovery > Core, see if any holds are created.

    If you can find any, turn them off. Then go back to the site and try to delete the folder and check the outcome.

    Note: it may need some time to take effect after disabling the policy. You may need to wait some time and check the outcome.

    More detailed information about Retention policy, holds and data loss prevention, you may refer to these articles:

    Create and configure retention policies

    Create an eDiscovery hold

    Data loss prevention reference

    Feel free to post back when you have any update.

    Have a nice day and stay safe.

    Best Regards,

    Tina

    0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Anonymous
    2021-07-21T13:37:59+00:00

    Site Contents page > Preservation hold library

    0 comments No comments
  2. Anonymous
    2021-07-21T14:00:59+00:00

    Hi Ong Yong Siang,

    Thank you for sharing the screenshot. As you can find Preservation hold library in site contents page, that means a retention policy is applied to the SharePoint site.

    Here is an article for reference:

    Learn about retention for SharePoint and OneDrive

    In this situation, as I shared before, I suggest you contact your Microsoft 365 admin to turn off the retention policy. After that, check if you can delete the folder.

    Note: it may need some time to take effect after disabling the policy. You may need to wait some time and check the outcome.

    Feel free to let us know how it goes.

    Hope you have a nice day.

    Best Regards,

    Tina

    0 comments No comments
  3. Anonymous
    2021-07-23T14:18:29+00:00

    Hi Ong Yong Siang,

    Can you delete the folder?

    Let us know when you have any update.

    Best Regards,

    Tina

    0 comments No comments
  4. Anonymous
    2021-08-08T03:06:25+00:00

    Issue is resolved using workaround which is to OFF Retention Policy

    There is no permanent solution to resolve this issue.

    Suggestion

    If Retention Policy can be only switched OFF temporary due to company's security and compliance, it is best to rebuild folders that cannot be deleted\renamed.

    For record keeping purpose

    Sharepoint having the following issue

    1. delete empty folders

    Error message: You have to delete all the items in this folder before you can delete the folder.

    1. rename folder

    Error message: Cannot lock file "XXXXXXXXX". Either the file is in use or the Web server is temporarily busy.

    0 comments No comments