Search.../

makeProfilePrivate( )

Removes the currently logged-in member from the site community and sets their profile to private.

Description

The makeProfilePrivate() function returns a Promise that resolves to a member object when the member's profile privacy is updated.

When a member's profile is private, they do not have access to the site's Members Area features, and their profile is hidden from other members and site visitors.

Notes:

  • The APIs in CurrentMember are only partially functional when previewing your site. View a published version of your site to see their complete functionality.
  • If a public member profile changes to private, their public content (such as forum posts and blog comments) remains publicly visible.

Syntax

function makeProfilePrivate(): Promise<Member>

makeProfilePrivate Parameters

This function does not take any parameters.

Returns

Fulfilled - Updated member.

Return Type:

Promise<Member>
NAME
TYPE
DESCRIPTION
_id
string

Member ID.

loginEmail
string

Email used by the member to log in to the site.

status
string

Member site access status.

One of:

  • "PENDING": Member created and is waiting for approval by site owner.
  • "APPROVED": Member can log in to the site.
  • "OFFLINE": Member is a guest author for the site blog and cannot log in to the site.
  • "BLOCKED": Member is blocked and cannot log in to the site.
  • "UNKNOWN": Insufficient permissions to get the status.
contactId
string

Contact ID.

privacyStatus
string

Member privacy status.

One of:

  • "PUBLIC": Member is visible to everyone.
  • "PRIVATE": Member is hidden from site visitors and other site members. Member is returned only to site contributors and apps with the appropriate permissions.
  • "UNKNOWN": Insufficient permissions to get the status.
activityStatus
string

Member activity status.

One of:

  • "ACTIVE": Member can write forum posts and blog comments.
  • "MUTED": Member cannot write forum posts or blog comments.
  • "UNKNOWN": Insufficient permissions to get the status.
_createdDate
Date

Date and time when the member was created.

_updatedDate
Date

Date and time when the member was updated.

lastLoginDate
Date

Date and time when the member last logged in to the site.

contactDetails
ContactDetails

Member's contact information. Contact information is stored in the Contact List.

profile
Profile

Profile display info.

Related Content:

Was this helpful?

Make the currently logged-in member's profile private

Copy Code
1import { currentMember } from 'wix-members-backend';
2
3export function myMakeProfilePrivateFunction() {
4 return currentMember.makeProfilePrivate()
5 .then((updatedMember) => {
6 const newPrivacyStatus = updatedMember.privacyStatus;
7 return updatedMember;
8 })
9 .catch((error) => {
10 console.error(error);
11 })
12}
13
14/* Promise resolves to:
15 * {
16 * "_id": "f32cbc51-a331-442b-86c2-2c664613e8b9",
17 * "_createdDate": "2021-08-02T23:14:42.000Z",
18 * "_updatedDate": "2021-08-02T23:14:58.345Z",
19 * "lastLoginDate": "2021-08-04T11:02:44.000Z",
20 * "contactId": "f32cbc51-a331-442b-86c2-2c664613e8b9",
21 * "loginEmail": "claude.morales@example.com",
22 * "status": "APPROVED",
23 * "privacyStatus": "PRIVATE",
24 * "activityStatus": "ACTIVE",
25 * "contactDetails": {
26 * "firstName": "Claude",
27 * "lastName": "Morales",
28 * "phones": [
29 * "0747-769-460"
30 * ],
31 * "emails": [
32 * "claude.morales@example.com"
33 * ],
34 * "addresses": [
35 * {
36 * "_id": "f0f4d905-488d-44db-9080-fc29078cfad5",
37 * "addressLine": "9373 Park Avenue",
38 * "addressLine2": "Berkshire",
39 * "city": "Ely",
40 * "subdivision": "GB-ENG",
41 * "country": "GB",
42 * "postalCode": "PD50 8EU"
43 * },
44 * {
45 * "country": "IL"
46 * }
47 * ],
48 * "customFields": {}
49 * },
50 * "profile": {
51 * "nickname": "Claude Morales",
52 * "slug": "claudemorales"
53 * }
54 * }
55 */