ShareMaster V2 is in beta, a complete rebuild. See what is new and request access →
Features All features overview
Migration Tools Overview Structure and content OneDrive ↔ SharePoint Content only Structure only Move / Copy Upload from this computer Download to this computer Dropbox to SharePoint Resume and incremental runs
Recycling Bin Overview Browse a site's recycle bin Empty recycle bins in bulk Restore and purge history
Archive Overview Configure the tenant On Demand Archive Restore Archived Files Archive Savings Report Blob Viewer
Optimise Storage Tools Overview Delete all items in a list Delete all files and folders in a library Remove empty folders Remove duplicate files Reduce image sizes Delete sites and subsites
SharePoint Tools Overview Tenant Explorer SharePoint Explorer Easy Settings Fix renamed groups List Explorer Search the Preservation Hold Library
Replace Overview Replace in SharePoint Replace in local files Find password-protected files
Shared Links Overview Report shared links Report unique permissions Remove a person from sharing links Remove shared links Remove unique permissions
Version History Overview Version trimming Version trimming report Reset file version
Reports Overview Inventory report Folder inventory Site and subsite storage Security matrix Teams permissions Pre-migration analysis Compare items Dropbox to Microsoft 365 compare Duplicate file report Empty folder report Image size report Recycle bin report Unused licences Report history
V2 beta Pricing Demos Blog Guides Use cases Compare Tools Alerts FAQ Contact Sign in Start free trial
  1. Home
  2. Documentation
  3. Optimise storage

Delete all files & folders in a library

Clear a library's contents, keep the library

Empties a document library, or one subfolder inside it, without deleting the library. Preview it first to see the count; the run itself always asks you to confirm before anything goes.

Makes changes. Deletes every file in the library or subfolder you pick, and its folders too unless the run has a filter such as a date. Recycle bin by default; permanent shows a red warning you must confirm.

What it does

  • How many files and folders are in scope, and how much storage they hold, before anything goes.
  • What a date limit would protect, if you only want to clear content older than a certain point.
  • What actually happened, per item.

How it runs

  1. Sign in and pick the target. A library, or one folder inside it.
  2. Set the options. Recycle bin or permanent, and optionally only items older than a date.
  3. Preview (recommended). Counts what is in scope. Nothing is deleted at this point.
  4. Confirm, then it runs. Recycling asks you to confirm; permanent deletion shows a red warning first. Cancel offers Finish the current item, Stop now, or Keep running. Nothing is left half-written: an item is either done or not started.

How it works

The run reads every file and folder in the library, or under the one folder you picked, with a read that works on libraries larger than the list view threshold. Each row is tested against what you chose: the rows you ticked in the picker (ticking nothing means the whole target, and ticking a folder means everything inside it), any created-before or modified-before date, a name filter, and a size range. A size range applies only to files, and an item with no date is kept when a date filter is on. A preview takes the same walk and removes nothing; the run reads the library again when you approve, so it acts on what is there at that moment.

Files are removed first, as they are found, a small group at a time. Each one goes to the site recycle bin or, only if you chose permanent deletion, is deleted outright. Folders are held back until every file has been dealt with and are then removed deepest first, so a folder never goes before the folders inside it. With no filter on, every folder in scope is removed too, which leaves the library itself empty but in place. With any filter on, including a date, no folder is removed: removing a folder takes everything inside it, and a folder's own name, size or date says nothing about the files it holds, so a filtered run removes matching files one by one and leaves every folder standing.

SharePoint answers for each file and folder separately. One that cannot be removed, for example a checked-out file, is counted as failed with SharePoint's reason and the run moves on. One that has already gone when the run reaches it is counted on its own as already gone, not as a removal and not as freed space. If the read of the library stops part way, the files already read are still removed but no folder is, because the run has not seen everything inside them, and the result says the scan was incomplete.

Freed space is counted only from files this run actually removed. In recycle mode it stays on the site's quota until the recycle bin is emptied; in permanent mode it is released straight away. Before each group is sent, the run records on this computer what it is about to remove, then what happened to each item, and the report and history entry are built from that record, so a stopped run still accounts for what it removed. Every preview and every run, finished or not, goes into Report History. The library itself and its settings are never removed.

What you get

An Excel workbook, named like contoso-delete-library-20260901-142207.xlsx, kept in Report History whether or not you save it.

Deleted Items sheet

One row per file or folder, with what happened to it.

ColumnExample
SiteContoso Projects
PathShared Documents/Clients/Northwind
NameProposal v4.pdf
KindFile
Size (KB)3,045
StatusRecycled

Summary sheet

Scope, options, counts and totals.

What you need

  • Write access to the library. Permanent deletion generally needs site collection administrator.

What it will not do

  • The library itself is kept. Its folders are removed too, deepest first, unless the run has a filter such as a date, in which case every folder is kept.
  • A checked-out file cannot be deleted. Those are reported rather than skipped silently.
  • Recycled content still counts against quota until the bin is purged.

See every feature