How to delete all the websites hosted in IIS?
You will end up in the situation to delete one or more website instances hosted in the IIS server. I know it’s a frustrating task to delete the sites one by one. I had a situation to delete the bulk number of sites from the dev server and can’t do that boring job of manual deletion. I figure out the way that Microsoft offers to delete the sites from the IIS application configuration file.
Here are steps to delete the website hosted in the IIS server,
-
Open the below file, C:\Windows\System32\inetsrv\Config\applicationHost.config
-
Navigate to
<sites>
tag and expand it. You can see all the sites hosted in your IIS server -
You can remove the particular site which you want to delete from the IIS server by removing the site tag
-
If you want to delete all the sites then remove all the
<site>...</site>
tags -
Save the applicationHost.config file.
-
Go to your IIS server and refresh the sites.
Example:
In the below screenshot, the removal of site tag will remove the default site from IIS.
Leave a comment