> 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: deleteBadge(_id: string) # Method package: wixMembersV2 # Method menu location: wixMembersV2 --> badges --> deleteBadge # Method Link: https://dev.wix.com/docs/velo/apis/wix-members-v2/badges/delete-badge.md # Method Description: Deletes a badge. The `deleteBadge()` function returns a Promise that resolves when the specified badge is deleted. The `badgeId` parameter must be an ID from your site's `Members/Badges` collection. Typically, you retrieve the ID from the collection using a query or through a dataset. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Delete existing badge. (dashboard page code) ```javascript import { badges } from 'wix-members.v2'; /* Sample _id value: '50dca3d3-f142-44ca-87e9-d9302e1d4dd5' */ export async function myDeleteBadgeFunction(_id) { try { const deletedBadge = await badges.deleteBadge(_id); console.log("Badge deleted: ", deletedBadge); return deletedBadge; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to void */ ``` ## Delete existing badge. (export from backend code) ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { badges } from 'wix-members.v2'; import { elevate } from 'wix-auth'; /* Sample _id value: '50dca3d3-f142-44ca-87e9-d9302e1d4dd5' */ export const myDeleteBadgeFunction = webMethod(Permissions.Anyone, async (_id) => { try { const elevatedDeleteBadge = elevate(badges.deleteBadge); const deletedBadge = await elevatedDeleteBadge(_id); console.log("Badge deleted: ", deletedBadge); return deletedBadge; } catch (error) { console.error(error); // Handle the error } }); /* Promise resolves to void */ ``` ---