SOLVED – You have to delete all the items in this folder before you can delete the folder.

Advertisement

For a folder on the team site., trying to delete it might show an error that says – “You have to delete all the items in this folder before you can delete the folder. Documents->Test1->Test2“. While trying to delete ‘Test2’ folder, the ‘Test2’ folder is empty and doesn’t have any files or folders in it. After clicking delete on a folder and ‘okay’ on the confirmation prompt, the folder does not go away. Here are a few solutions to this problem:

Solution 1

Instead of deleting the folder try moving the folder to an unused Teams document library. For example:-

  • Right-click on the folder in your OneDrive
  • Click “View Online”. Once open in the browser
  • Select the folder you want to get rid of, i.e Documents -> Test1
  • Now click Move.
  • Select a different Sharepoint site to move it to unused Team.
  • Once the folder and subfolders are successfully moved to the unused Team, you don’t have to deal with those folders in my personal One Drive.

You May Also Like: SOLVED – How To Get All Data From Last 5 Minutes in SQL

Solution 2

  • Go to library settings -> Manage files which have no checked in version -> Make sure all files are checked in.
  • Go to Microsoft 365 admin center -> Security -> Policies -> Retention.
  • Try to deletethe folder by using PowerShell.

Solution 3

You can directly delete top-level folder without deleting any sub folder or files.

You May Also Like: SOLVED – How To Exclude In-app toolbar in VS 2022

Solution 4

Either you disable the Hold for the site from Office 365 Security and Compliance center as Global Administrator (and allow some time to take effect!) or as the error message says, delete all files and sub-folders inside the folder first! You can use “View in File Explorer” or PowerShell too to make it easier.

You May Also Like: SOLVED – How To Update Connection Policy Of Synapse Dedicated SQL Pools

We hope the solutions in the above-mentioned article were helpful. Feel free to share your views with us.

Tagged with 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>