User Documentation

User:Delete_Form template tag

The User:Delete_Form function allows you and/or your users to delete their member account via the front end. Super Admins and member groups that are allowed to administrate other users can delete other user accounts. Super Admins cannot be deleted with this form. Regular members need to have the EE settings for ability to delete own account to use this function.

{exp:user:delete_form} content {/exp:user:delete_form}

Parameters

The following parameters are available for use:

error_page=

error_page="user/error_template"

This parameter allows you to bypass the EE message template for displaying errors, and instead show your own regular template with the error messages. Error template must follow guidelines of User Error Page.

form:attribute=

form:class="your_class"

This parameter allows you to control any form attribute for the form in your template. Simply replace attribute with an attribute name such as id, name, class, etc, and specify a value for that attribute. You can specify this parameter multiple times to control as many attributes as necessary. This would normally be done to control your form with Javascript or style it with CSS.

return=

return="user/success"

This parameter allows you specify a return URL you'd like the user to be returned to after submitting the form.

secure_action=

secure_action="yes"

This parameter allows you to set the action on the form to have https://. Use for processing forms with SSL.

secure_return=

secure_return="yes"

This parameter allows you to set the return on the form to have https://. Use for processing forms with SSL.

Variables

Most standard member fields are available for use.

Form Fields

The following parameters are available for use:

password=

<input type="password" name="password" />

This field is required, as the current password is needed to delete the account. If a user is deleting their own account, they enter their password. If an administrator (any member of a member group with member administration privileges) deletes another user's account, the admin enters their own password.

Examples

The following is a complete example of how to implement this function. Access the template with a member ID in the URL. There is also a built in confirmation warning:

{exp:user:delete_form}
    <h2>Delete Account: {screen_name}</h2>
    <h3>You must confirm your password to complete this action.</h3>
    <p>Are you sure you wish to delete your account? All entries, posts, comments, and other
content associated with your account will also be deleted.</p>
    <p><strong style="color:red;">WARNING: THIS ACTION CANNOT BE UNDONE!</strong></p>
    <p>
        <label for="password">Password:</label>
        <input type="password" name="password" id="password" /></p>
        <button type="submit">Delete My Account</button>
    </p>
{/exp:user:delete_form}

Support

Having problems setting up and/or using User? Support is offered from 10am to 4pm EST weekdays. Send us an email at help@eeharbor.com and we will respond as quickly as we can.