> 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 # Method name: deleteDataCollection(dataCollectionId: string) # Method package: wixDataV2 # Method menu location: wixDataV2 --> collections --> deleteDataCollection # Method Link: https://dev.wix.com/docs/velo/apis/wix-data-v2/collections/delete-data-collection.md # Method Description: Deletes a data collection. > **Note:** > Once a collection is deleted, it can only be restored for limited amount of time. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Delete an existing collection (dashboard page code) ```javascript import { collections } from "wix-data.v2"; // Deleting the collection whose _id is "myMusicCollection": // const dataCollectionId = "myMusicCollection" export async function myDeleteDataCollectionFunction(dataCollectionId) { try { await collections.deleteDataCollection(dataCollectionId); return; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to void */ ``` ## Delete an existing collection (export from backend code) ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { collections } from 'wix-data.v2'; // Deleting the collection whose _id is "myMusicCollection": // const dataCollectionId = "myMusicCollection" export const myDeleteDataCollectionFunction = webMethod(Permissions.Anyone, async (dataCollectionId) => { try { await collections.deleteDataCollection(dataCollectionId); return; } catch (error) { console.error(error); // Handle the error } }); /* Promise resolves to void */ ``` ---