makeProfilePrivate( )


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

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 member data in the resolved promise will only include custom fields from your site's contacts if they are added to your site Members in your site's dashboard.
  • 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) remain publicly visible.
Method Declaration
Copy
function makeProfilePrivate(): Promise<Member>;
Request
This method does not take any parameters
Returns
Return Type:Promise<Member>
Make the currently logged-in member's profile private
JavaScript
import { currentMember } from "wix-members-frontend"; // ... currentMember .makeProfilePrivate() .then((updatedMember) => { const newPrivacyStatus = updatedMember.privacyStatus; console.log("Privacy status was changed to", newPrivacyStatus); }) .catch((error) => { console.error(error); }); /* Returned member object: * { * "_id": "f32cbc51-a331-442b-86c2-2c664613e8b9", * "_createdDate": "2021-08-02T23:14:42Z", * "_updatedDate": "2021-08-02T23:14:58.345Z", * "lastLoginDate": "2021-08-12T19:46:33Z", * "loginEmail": "claude.morales@example.com", * "contactId": "f32cbc51-a331-442b-86c2-2c664613e8b9", * "status": "APPROVED", * "privacyStatus": "PRIVATE", * "activityStatus": "ACTIVE", * "profile": { * "nickname": "Claude Morales", * "slug": "claudemorales" * }, * "contactDetails": { * "firstName": "Claude", * "lastName": "Morales", * "phones": [ * "0747-769-460" * ], * "emails": [ * "claude.morales@example.com" * ], * "addresses": [ * { * "country": "GB" * }, * { * "id": "f0f4d905-488d-44db-9080-fc29078cfad5", * "addressLine": "9373 Park Avenue", * "addressLine2": "Berkshire", * "city": "Ely", * "subdivision": "GB-ENG", * "country": "GB", * "postalCode": "PD50 8EU" * } * ], * "customFields": {} * } * } */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?