> 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: leaveCommunity() # Method package: wixMembersV2 # Method menu location: wixMembersV2 --> members --> leaveCommunity # Method Link: https://dev.wix.com/docs/velo/apis/wix-members-v2/members/leave-community.md # Method Description: Removes the currently logged-in member from the site community and sets their profile to private. When a member's profile is private, they do not have access to the site's [Members Area](https://support.wix.com/en/article/about-members-area) features — such as chat, forum, and followers — and their profile is hidden from other members and site visitors. > **Notes:** > + If a member leaves the site's community, their content (such as forum posts and blog comments) remain publicly visible. > + Only logged-in members can call this function without elevated permissions. > + To call this function as a different identity, [elevated permissions](https://www.wix.com/velo/reference/wix-auth/elevate) are required. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Make the currently logged-in member's profile private (export from backend code) ```javascript import { members } from 'wix-members.v2'; import { webMethod, Permissions } from 'wix-web-module'; export const myLeaveCommunityFunction = webMethod( Permissions.SiteMember, async () => { try { const member = await members.joinCommunity(); console.log('Member removed from site community:', member); return member; } catch (error) { console.error(error); // Handle the error } } ); /* Promise resolves to: * { * "member": { * "createdDate": "2024-02-22T13:52:00Z", * "id": "7d368843-6f0c-4037-8d0e-b7e36a8a0c32", * "updatedDate": "2024-02-22T13:52:00.674Z", * "activityStatus": "ACTIVE", * "contact": { * "contactId": "ff20c02e-3d13-4412-9529-d628aa0abc12", * "firstName": "John", * "lastName": "Doe", * "phones": [], * "emails": [], * "addresses": [], * "customFields": {} * }, * "contactId": "ff20c02e-3d13-4412-9529-d628aa0abc12", * "lastLoginDate": "2024-02-29T11:40:21Z", * "loginEmail": "johndoe@example.com", * "loginEmailVerified": true, * "privacyStatus": "PUBLIC", * "profile": { * "nickname": "John Doe", * "slug": "johndoe", * "photo": { * "id": "", * "url": "https://example.com/newphoto.jpg", * "height": 0, * "width": 0 * } * }, * "status": "APPROVED" * } * } */ ``` ## Make the currently logged-in member's profile private (dashboard page code) ```javascript import { members } from 'wix-members.v2'; export async function myLeaveCommunityFunction(){ try { const member = await members.joinCommunity(); console.log('Member removed from site community:', member); return member; } catch (error) { console.error(error); // Handle the error } }; /* Promise resolves to: * { * "member": { * "createdDate": "2024-02-22T13:52:00Z", * "id": "7d368843-6f0c-4037-8d0e-b7e36a8a0c32", * "updatedDate": "2024-02-22T13:52:00.674Z", * "activityStatus": "ACTIVE", * "contact": { * "contactId": "ff20c02e-3d13-4412-9529-d628aa0abc12", * "firstName": "John", * "lastName": "Doe", * "phones": [], * "emails": [], * "addresses": [], * "customFields": {} * }, * "contactId": "ff20c02e-3d13-4412-9529-d628aa0abc12", * "lastLoginDate": "2024-02-29T11:40:21Z", * "loginEmail": "johndoe@example.com", * "loginEmailVerified": true, * "privacyStatus": "PUBLIC", * "profile": { * "nickname": "John Doe", * "slug": "johndoe", * "photo": { * "id": "", * "url": "https://example.com/newphoto.jpg", * "height": 0, * "width": 0 * } * }, * "status": "APPROVED" * } * } */ ``` ---