Delete My Account Pro

Give registered users the ability to delete their own account.

Pro Plugins
The settings interface of the Delete My Account Pro plugin for WordPress

What does Delete My Account Pro do?

Delete My Account Pro gives users the ability to delete their own accounts, negating the need for a website administrator to become involved.

The plugin can be configured to:

  • Selectively display the ‘Delete my account’ button to users based on specified roles.
  • Delete user accounts on a single site or across the entire multisite network.
  • Remove user comments on a single site or across the entire multisite network.
  • Provide users with an automatic summary of the account deletion consequences.
  • Specify additional summary items.
  • Present a customised warning message to users prior to account deletion.
  • Send a confirmation to users after their account has been successfully deleted.
  • Notify the site administrator (or alternative recipient) when a user deletes their account.
  • Optionally redirect users to a specific page or keep them on the same page following account deletion.
  • Execute a custom PHP function when a user is deleted.

Providing users with this functionality benefits everyone involved. Users can self-delete their accounts without any hassle, and website owners are relieved of the administrative burden of manually handling account deletions.

WordPress Let Users Delete Their Account

Note: The appearance of this interface will be automatically adopted from your theme, eliminating the necessity to style it (unless you really want to).

Where are the settings?

Go to Settings -> Delete My Account Pro to configure the plugin.

How do I use the plugin?

The ‘Delete My Account’ interface can be placed on any page, post, or theme template using one of the shortcodes provided at the end of the settings page.

WordPress Delete My Account

If using the Gutenberg editor, insert the shortcode like this:

WordPress Delete My Account

If using the classic editor, paste the [delete_my_account_pro] shortcode anywhere into the editor.

Execute a custom PHP function after the user account has been deleted

This might be useful, for example, in scenarios where you need to eliminate any lingering remnants associated with a deleted user’s account. This may include deleting purchase history, managing product licenses or deleting posts.

Note: Use this feature at your own risk. The responsibility for the custom function you create rests entirely with you. It’s important to understand that the ‘Delete My Account Pro’ plugin cannot identify potential issues with your custom function code or what impact it could have on your website. It is strongly advised to conduct thorough testing in conjunction with the ‘Delete My Account Pro’ plugin before deploying it to a live production environment. And as always, make sure you have backups especially if your function manipulates the database.

If you do decide that you want to execute additional actions for the deleted user account, it’s imperative to include the function within a plugin (your custom function will not execute if it resides in your theme’s functions.php file due to the order in which WordPress expects functions to run).

This basic plugin should get you started.

<?php /*
Plugin Name:    Further Account Actions
Plugin URI:     https://example.com
Description:    This plugin is used to perform additional actions after a user deletes thier account.
Version:        1.0.0
Author:         Your Website Name
Author URI: 	https://example.com
*/
function my_cleanup_function($user_id, $user_email) {
    /*
        Your custom function goes here.
        Note the $user_id and $user_email are returned for your convenience.
    */
}

Note: For the function to work, the function name needs to match the one you specify in settings (in this example, my_cleanup_function).

Summary

Follow these steps:

  1. Create a new plugin with your custom function
  2. Activate your new plugin
  3. Go to ‘Delete My Account Pro’ settings and scroll down to ‘Advanced Functionality’
  4. Enable the ‘I understand the risks’ checkbox and enter the name of the function you created in your plugin.

Note: If you ever change the name of your function in your plugin, don’t forget to also change the new name in ‘Delete My Account Pro’ settings.

Where do I enter my license key?

Go to Settings -> Delete My Account Pro and enter your license key.

Once entered and activated, the settings interface will automatically load.

Is the plugin price a one-time payment or an annual subscription?

The choice is yours.

Twelve months after your initial purchase you will have the option to renew your support license, but it’s not mandatory.

Should you decide not to renew your support license, your product will continue to function without any limitations. However, it won’t receive updates or be eligible for support until you renew.

Changelog

1.1.0 (1st January 2024)

  • Improvement: Run a custom function after user account it deleted.
  • Improvement: Include additional summary list items.
  • Fix: Issue where multisite network option was available on ‘Delete comments’ option when site is not multisite.

v1.0.0 (30th October 2023)

  • Initial release.