Deleting web application is equally important to maintain SharePoint farm. It is very significant that we periodically delete the web applications that are no longer in use. In this article, we will go through the options available for deleting the web application manually.
First, we will go through the manual steps so that it will be easier to understand what each option is used for.
The step-by-step process of deleting the Web Application manually
- Go to Central Administration >> Application Management >> Manage web applications
- Click on a Web application that you want to delete
- Go to Ribbon >> click on Delete button Dropdown. You will get two options
- First option: Delete Web Application
- Delete Content Database – If you tick Yes, Content Database associated with web application will be deleted. Once the content database is deleted, all the sites within the content database will also be deleted
- Delete IIS web sites: If you tick Yes, the IIS web site and all the IIS metadata related to this web application will be deleted. See Screenshot below
- Second Option: Remove SharePoint from IIS Web Site
- Select IIS web site and zone to remove: This option is used to delete the web application Extension/Zone. Make sure you don’t delete the default zone. Mostly this is used to delete the extension of the main web application
- Delete IIS web sites: If you tick Yes, the IIS web site and all the IIS metadata related to this web application will be deleted.
Delete Web Application using PowerShell
- For easy and quick deletion of Web Application, most of the administrators prefer to run PowerShell Command. Make sure you run the PowerShell using the Farm administrator account.
- Open the SharePoint Management Shell and run the below command.
- There are two examples given. Example 1 deletes zone and Example 2 deletes entire web application and content database.
- ###Example 1:###
- # Specify Web application URL here
- $webApplcation = “https://sitename”
-
- # This command will delete the web
application Extension/Zone (Internet).
- Remove-SPWebApplication –Identity $webApplcation –Zone
Internet –Confirm
-
-
- ###Example 2:###
-
- # Specify Web application URL here
- $webApplcation = https://sitename
-
- # This command will delete the web
application from IIS and Content Database.
- Remove-SPWebApplication –Identity $webApplcation
-DeleteIISSite -RemoveContentDatabases
-Confirm
Conclusion
We went through manual steps as well as PowerShell command to delete Web application, which is one of the most essential tasks from SharePoint administration perspective. This article was performed in SharePoint 2013 On-premises.
You can go through a detailed explanation to delete Web Application using Powershell if you need in-depth knowledge of the syntax.