deleteMember( )


Deprecated. This function will continue to work, but a newer version is available at deleteMember().

Deletes a member.

The deleteMember() function returns a Promise that resolves to a member object when the specified member is deleted.

This function permanently deletes a member. Once deleted, a member cannot be restored.

Migration Instructions

If this function is already in your code, it will continue to work. To stay compatible with future changes, migrate to deleteMember().

To migrate to the new function:

  1. Add the new import statement:

    Copy
    import { members } from "wix-members.v2";
  2. Test your changes to make sure your code behaves as expected.

Method Declaration
Copy
function deleteMember(id: string): Promise<void>;
Method Parameters
idstringRequired

ID of the member to delete.

Delete a member by ID

This example uses a deprecated function.

JavaScript
import { Permissions, webMethod } from "wix-web-module"; import { members } from "wix-members-backend"; // Sample id value: // 'efab296e-2687-4751-9956-ee73200dd4bb' export const myDeleteMemberFunction = webMethod(Permissions.Anyone, (id) => { return members .deleteMember(id) .then(() => { console.log("Member deleted"); }) .catch((error) => { console.error(error); }); });
Errors

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

Did this help?