# Delete Site Collection
Deletes a SharePoint site collection by processing rows from an Excel file. When targeting by matter code, also removes the corresponding entries from the matter list and My Matters list.
Filename pattern: filename must contain deletesitecollection (case-insensitive).
Example: 20240115 deletesitecollection decommission.xlsx
# Columns
| Name | Required | Description |
|---|---|---|
| Url / SiteUrl / WebUrl | Conditional | Server-relative URL of the site collection. Required when MatterCode is not provided. |
| MatterCode | Conditional | Matter code used to resolve the site URL from the matter list. Required when Url is not provided. |
| ClientCode | No | Client code used together with MatterCode to identify the matter. |
| Permanent | No | Boolean. true permanently deletes the site collection. false (default) sends it to the recycle bin. |
Either Url or MatterCode must be provided.
# Behavior
Deletes the resolved site collection. When Permanent is false (default), the site collection is sent to the recycle bin; when true, it is permanently deleted. When targeting by MatterCode, the handler also removes the corresponding entries from the Matter list and My Matters list.
# Related links
- Archive Site Collection handler — archive rather than delete
- Delete Web handler — delete a subsite (web) rather than a full site collection