> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # BulkDeleteSite # Package: sites # Namespace: SiteActionsService # Method link: https://dev.wix.com/docs/api-reference/account-level/sites/site-actions/bulk-delete-site.md ## Introduction This endpoint enables you to delete multiple sites. This is not a permanent delete. Sites are moved to the trash bin and can be restored through site collaborators. Learn more about [deleting multiple sites](https://support.wix.com/en/article/moving-a-site-to-trash). > **Important:** This call requires an account level API key. --- ## REST API ### Schema ``` Method: bulkDeleteSite Description: This endpoint enables you to delete multiple sites. This is not a permanent delete. Sites are moved to the trash bin and can be restored through site collaborators. Learn more about [deleting multiple sites](https://support.wix.com/en/article/moving-a-site-to-trash). > **Important:** This call requires an account level API key. URL: https://www.wixapis.com/v1/bulk/sites/delete Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: ids Method parameters: param name: ids | type: array | description: Site GUIDs. Min: 1 site GUID
Max: 20 site GUIDs | required: true Return type: BulkDeleteSiteResponse - name: results | type: array | description: List of deletion results. - name: itemMetadata | type: ItemMetadata | description: Result of deletion request per site describing the success or failure of each deletion. - name: id | type: string | description: Site GUID. - name: originalIndex | type: number | description: Index of the site in the request array. Allows for correlation between request and response. - name: success | type: boolean | description: Whether the requested action was successful for the site. When `false`, the action failed and an `error` object is populated. - name: error | type: ApplicationError | description: Details about the error. - name: code | type: string | description: Error code. - name: description | type: string | description: Description of error. - name: bulkActionMetadata | type: BulkActionMetadata | description: Summary of deletion data. - name: totalSuccesses | type: number | description: Number of sites that were deleted successfully. - name: totalFailures | type: number | description: Number of sites that were not deleted successfully. ``` ### Examples ### Bulk delete 2 sites ```curl curl 'https://www.wixapis.com/site-actions/v1/bulk/sites/delete' \ -H 'accept: application/json' \ -H 'content-type: application/json' \ -H 'authorization: ' \ -d '{ "ids": [ "9f023696-c821-4e09-b1d0-55357272ff2a", "da0c7663-e375-48a9-b273-f0bd45c933a9" ] }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.sites.SiteActionsService.bulkDeleteSite(ids) Description: This endpoint enables you to delete multiple sites. This is not a permanent delete. Sites are moved to the trash bin and can be restored through site collaborators. Learn more about [deleting multiple sites](https://support.wix.com/en/article/moving-a-site-to-trash). > **Important:** This call requires an account level API key. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: ids Method parameters: param name: ids | type: array | description: Site GUIDs. Min: 1 site GUID
Max: 20 site GUIDs | required: true Return type: PROMISE - name: results | type: array | description: List of deletion results. - name: itemMetadata | type: ItemMetadata | description: Result of deletion request per site describing the success or failure of each deletion. - name: _id | type: string | description: Site GUID. - name: originalIndex | type: number | description: Index of the site in the request array. Allows for correlation between request and response. - name: success | type: boolean | description: Whether the requested action was successful for the site. When `false`, the action failed and an `error` object is populated. - name: error | type: ApplicationError | description: Details about the error. - name: code | type: string | description: Error code. - name: description | type: string | description: Description of error. - name: bulkActionMetadata | type: BulkActionMetadata | description: Summary of deletion data. - name: totalSuccesses | type: number | description: Number of sites that were deleted successfully. - name: totalFailures | type: number | description: Number of sites that were not deleted successfully. ``` ### Examples ### bulkDeleteSite ```javascript import { siteActions } from '@wix/sites'; async function bulkDeleteSite(ids) { const response = await siteActions.bulkDeleteSite(ids); }; ``` ### bulkDeleteSite (with elevated permissions) ```javascript import { siteActions } from '@wix/sites'; import { auth } from '@wix/essentials'; async function myBulkDeleteSiteMethod(ids) { const elevatedBulkDeleteSite = auth.elevate(siteActions.bulkDeleteSite); const response = await elevatedBulkDeleteSite(ids); } ``` ### bulkDeleteSite (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { siteActions } from '@wix/sites'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { siteActions }, // Include the auth strategy and host as relevant }); async function bulkDeleteSite(ids) { const response = await myWixClient.siteActions.bulkDeleteSite(ids); }; ``` ---