As a SharePoint beginner, you must know how to delete a SharePoint site. In this tutorial, I will explain how to delete the SharePoint Online site using different ways. Such as:
- Delete SharePoint Online Site from SharePoint Admin Center
- Delete SharePoint Online Site from SharePoint Home Page
- How to Delete SharePoint Site using PowerShell
- How to Delete Multiple SharePoint Online Sites using PowerShell
Delete SharePoint Site From SharePoint Admin Center
To delete a SharePoint Online site [Commumication site or Team site] from the SharePoint admin center, you can follow the below-mentioned steps. Such as:
1. Open your SharePoint admin center [https://<tenant>-admin.sharepoint.com], expand the Sites dropdown, and select Active sites.
2. Now, select the specific SharePoint site and click on the Delete option, as shown below.
3. Once you select the delete button, it will give the confirmation message [Delete Admin Team?], and select the Delete option.
4. Suppose you want to get the deleted SharePoint site; select the Deleted sites option where you find the deleted sites.
Output:
This way, you can delete or remove a SharePoint site from the SharePoint admin center.
Delete Sharepoint Site From the Home Page
Next, I will show you how to delete the SharePoint site from the SharePoint site home page. For that, follow the below steps.
1. On the SharePoint Home Page -> Click on the Gear icon -> Select Site information option under the Settings window, as show below.
2. Now, select the Delete site option under the Site information page.
3. Whenever the user selects the delete site option, a confirmation message will appear. You can also select the check box [Yes, delete this site and its associated content]. Finally, click on the Delete option.
4. In the same way, you can also delete the SharePoint site from the Site Actions [Site Information -> View all site settings -> Site Actions -> Delete this site].
5. Next, select the Delete option to receive the confirmation message [Are you sure you want to send this website to the site collection recycle bin?], and select the OK button.
This is how we can delete the SharePoint Online site from the SharePoint Online home page.
How to Delete SharePoint Online Site using PowerShell
Suppose you want to delete the SharePoint site using PowerShell [SharePoint Online Management PowerShell]; follow these two different methods. Such as:
- Remove-SPOSite
- Remove-SPODeletedSite
Note:
To execute PowerShell Commands, you can use either Windows PowerShell ISE or Visual Studio Code.
Delete SharePoint Site using PowerShell [Remove-SPOSite]
We can use the Remove-SPOSite cmdlet to delete a specific SharePoint Online site from the SharePoint Admin center and move it to the SharePoint Deleted site/recycle bin page.
Syntax of the PowerShell Remove-SPOSite:
Remove-SPOSite
-Identity <SpoSitePipeBind>
[-Confirm]
[-Nowait]
[-WhatIf]
Where,
- Identity = We can specify the exact SharePoint site URL
- Confirm = It will ask for your confirmation before executing the command
- Nowait = We can specify that the script will be expected immediately without any delay
- WhatIf = It specifies what would happen if the command runs. The command is not run
Example-1:
Suppose you want to delete the SharePoint Online site [ProjectSite] from the SharePoint Admin center using the PowerShell Remove-SPOSite command. Follow the code below and run the script.
Remove-SPOSite -Identity https://szg52.sharepoint.com/sites/ProjectSite
Once you run the script, it will give the confirmation message. Then, click on the Yes to All option to delete the specific site.
Finally, to check the deleted SharePoint site, go to the SharePoint admin center and click on the Deleted sites option to get the output.
Output:
Example-2:
Similarly, if you want to delete a SharePoint Online site with a confirmation message and move it into the recycle bin, follow the script below.
Remove-SPOSite -Identity https://szg52.sharepoint.com/sites/AdminTeam -Confirm
Note:
If you use the -Confirm:$false parameter, the SharePoint site will be automatically deleted from the Active sites and moved to the Deleted sites.
Have a look at the below screenshot for the output.
Delete SharePoint Site using PowerShell [Remove-SPODeletedSite]
In the same way, if you want to delete the SharePoint Online site using PowerShell, you can use the Remove-SPODeletedSite cmdlet to delete the site permanently.
Follow the below syntax:
RemoveSPODEletedSite
-Identity <SpositePipeBind>
[-Confirm]
[-NoWait]
[-WhatIf]
Example:
In this example, I will show how to delete a SharePoint site permanently using the Remove-SPODeletedSite cmdlet. Follow the script below.
Remove-SPODeletedSite -Identity https://szg52.sharepoint.com/sites/ProjectSite -NoWait
Once your all updates are done, click on the Yes button. Have a look at the below screenshot for the output.
Output:
How to Delete Multiple SharePoint Sites using PowerShell
Finally, I will discuss how to delete multiple SharePoint Online sites using PowerShell. In this case, you can use Remove-SPOSite command.
Example:
Suppose you want to delete two SharePoint Online sites from the SharePoint Admin center, follow the below script.
$siteUrls = @(
"https://szg52.sharepoint.com/sites/Admin",
"https://szg52.sharepoint.com/sites/DeereandCompany"
)
# Loop through the list and delete each site
foreach ($url in $siteUrls) {
Remove-SPOSite -Identity $url -Confirm:$false
}
Where,
- $siteUrls: It specifies the URLs of the SharePoint sites
- foreach: It will loop iterates through each site URL
- $siteUrls: It specifies the URLs of the SharePoint sites
- foreach: It will loop iterates through each site URL
Once all your updates are done, have a look at the below screenshot for the output.
Output:
This way, we can delete multiple SharePoint sites using PowerShell.
From this SharePoint Online tutorial, I have explained how to delete a SharePoint Site from the SharePoint Admin Center and how to delete a SharePoint Online Site from the SharePoint site home page.
Also, we covered how to delete a SharePoint Site using PowerShell and how to delete multiple SharePoint Sites using PowerShell.
You may also like the following tutorials:
- SharePoint Online Recycle Bin
- SharePoint List View
- How to Share SharePoint Site with External Users?
- How to Manage Alerts in SharePoint Online
- SharePoint Site Left Navigation or Quick Launch
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com
Hi Bhawana,
Thanks for such a great article. I have one question, In a SharePoint On-Premise, how one can delete SharePoint personal site of a user using Rest API?