Unable to Delete Default Document Library from Sharepoint Page

Super Contributor

I've created a new page in SharePoint Online.  I always create a NEW document library so they all have unique names.  There is NO option to remove or delete the default one called Documents.  Even though it's not on the page, it's still there in the SharePoint App and OneDrive App (click Libraries > page and it's still showing).


I've gone so far as to stop inheriting permissions and removed everything but it's still there for all users and causes lots of confusion.  I've even had to rename it (DO NOT USE) yet it looks really bad when everyone sees that.  It also shows in the Copy To and Move To areas of SharePoint for this page adding even more confusion.

Why can't it be removed on a page but it can on a classic site/subsite?


To clarify in Site Contents there is no remove option.  In library settings, there is no delete.  

4 Replies

@luvsql there is the Delete this document library option in the Library Settings page which will work on the default Documents Library and delete it:


Los Gallardos
Microsoft Power Automate Community Super User

@RobElliottThere is NO delete option.  There is only a delete option on NEW document libraries, not the default.Settings.png

best response confirmed by Norman Young (MVP)

@luvsql then your site must be connected to an Office 365 Group. Sites that aren't connected to an Office 365 Group DO have the delete this Document Library link on the default Document Library as in my previous screenshot. All my sites which are not connected to an Office 365 Group DO have the link. Sites that are connected to an Office 365 Group do not.


Los Gallardos
Microsoft Power Automate Community Super User


You can use following code to delete the library as well :
#Custom function to delete a SharePoint Online document library using powershell
Function Delete-SPODocumentLibrary
[string]$SiteURL = $(throw "Please Enter the Site URL!"),
[string]$LibraryName = $(throw "Please Enter the Library Name to Delete!")
Try {
#Get Credentials to connect
$Cred= Get-Credential
$Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password)

#Setup the context
$Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
$Ctx.Credentials = $Credentials

#Get the Document Library and set allow deletion flag
$Library.AllowDeletion = $True

#Delete the Document Library - Send to Recycle bin
$Library.Recycle() | Out-Null #To permanently delete, call: $Library.DeleteObject()

Write-Host "Document Library: '$LibraryName' has been Deleted Successfully!" -ForegroundColor Green
Catch {
write-host -f Red "Error Deleting Document Library!" $_.Exception.Message

#Call the function to delete a document library
Delete-SPODocumentLibrary -SiteURL "" -LibraryName "Portal - Dev Documents"