> 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: unassignBadge(_id: string, memberIds: Array) # Method package: wixMembersV2 # Method menu location: wixMembersV2 --> badges --> unassignBadge # Method Link: https://dev.wix.com/docs/velo/apis/wix-members-v2/badges/unassign-badge.md # Method Description: Removes site members from an assigned badge. The `unassignBadge()` function returns a Promise that resolves when the specified members are removed as holders of the specified badge. 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. ## Remove assigned badge from member. (dashboard page code) ```javascript import { badges } from 'wix-members.v2'; /* Sample _id value: '215be5d9-4b32-4861-9eb5-2152930dd0b4' * * Sample memberIds value: * [ * '7d368843-6f0c-4037-8d0e-b7e36a8a0c32', * 'a1b2c3d4-e5f6-7890-1234-56789abcdef0', * 'f0e1d2c3-ba98-7654-3210-fedcba987654' * ] */ export async function myUnassignBadgeFunction(_id, memberIds) { try { const unassignedMembers = await badges.unassignBadge(_id, memberIds); console.log('Success! Created/updated result:', unassignedMembers); return unassignedMembers; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to void */ ``` ## Remove assigned badge from member. (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: '215be5d9-4b32-4861-9eb5-2152930dd0b4' * * Sample memberIds value: * [ * '7d368843-6f0c-4037-8d0e-b7e36a8a0c32', * 'a1b2c3d4-e5f6-7890-1234-56789abcdef0', * 'f0e1d2c3-ba98-7654-3210-fedcba987654' * ] */ export const myUnassignBadgeFunction = webMethod(Permissions.Anyone, async (_id, memberIds) => { try { const elevatedUnassignBadge = elevate(badges.unassignBadge); const unassignedMembers = await elevatedUnassignBadge(_id, memberIds); console.log('Success! Created/updated result:', unassignedMembers); return unassignedMembers; } catch (error) { console.error(error); // Handle the error } }); /* Promise resolves to void */ ``` ---