Export (0) Print
Expand All

Deleteweb: Stsadm operation (Office SharePoint Server)

Office 2007

Updated: April 28, 2009

Applies To: Office SharePoint Server 2007

Updated: 2009-04-28

Operation name: Deleteweb

Deletes a subsite from a site collection.

If the site collection is live, then you would use the url parameter to specify the URL of the subsite that should be deleted.

If the site collection is orphaned, then you would use the force parameter with the webid parameter to specify the orphaned site that should be deleted from the site collection. For more information, see the Remarks section.

The force and webid parameters, which are used to delete orphaned site collections, were first introduced in Microsoft Office SharePoint Server 2007 with Service Pack 2 (SP2).

NoteNote:

To delete a live subsite, in addition to the normal security requirements of Stsadm, you must have been granted the Manage Web Site permission on the subsite being deleted.

Syntax

For deleting a live site within a site collection:

stsadm -o deleteweb

   -url <URL name>

For deleting a site within an orphaned site collection or an orphaned site within a site collection:

   -force

   -webid <Web ID>

   -databasename <database name>

   -databaseserver <database server name>

Parameters

Parameter name

Value

Required?

Description

url

A valid URL name, such as http://server_name/sites/site_name/subsite_name

Yes

The URL of the subsite to delete.

force

<none>

Yes

Specifies a forceful method to delete a subsite within a site collection. This is used to delete sites within orphaned site collections or orphaned sites within a site collection.

webid

A valid GUID of a site, such as "064d8e7b-b349-4693-bd67-dcefed3bf466"

Yes

Specifies the ID of the site that should be deleted.

databasename

A valid name, such as "DB1"

Yes

Specifies the name of the content database that contains the site that should be deleted.

databaserver

A valid name, such as "DS1"

Yes

Specifies the name of the database server instance hosting the content database that contains the site that should be deleted.

Remarks

In this article, the command-line syntax is displayed differently than the syntax in command-line help.

A site map contains site collections that are browsable and registered. Site collections that are not registered in the site map are commonly referred to as "orphaned" site collections.

Site collections typically become orphaned when they are in a content database that is being attached to a Web application, but the Web application already contains a site collection with the same Uniform Resource Locator (URL) path. Because site collections cannot share the same URL path in a Web application, only the first site collection registered in the site map will be accessible. All other site collections that use the same URL path cannot be registered in the site map and are considered orphans. The orphaned site collection data still exists, but you can only access it by detaching its content database from the current Web application, and then attaching it to a Web application that does not have a site collection registered at that URL path.

Examples

To delete an operational subsite named "http://server_name/sites/site_name/subsite_name", type the following syntax:

stsadm -o deleteweb -url http://server_name/sites/site_name/subsite_name

To delete an orphaned subsite named "http://server_name/sites/site_name/subsite_name" from a database server named DS1 and a database name called DB1, perform the following steps:

  1. Use the enumallwebs operation to find the subsite whose URL matches "/sites/site_name/subsite_name". Its parent site collection XML tag (that is, the Web tag) should have an InSiteMap attribute that has a value equal to False. A value of False means this site collection is orphaned.

  2. Use the value of the ID attribute from the matching Web tag and use it as the value of the webid parameter of the deleteweb operation.

    For example:

    stsadm -o deleteweb -force -webid 064d8e7b-b349-4693-bd67-dcefed3bf466 -databaseserver DS1 -databasename DB1

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft