Would you like to allow users to delete their own WordPress accounts? If you allow a user to register on your WordPress site and a user no longer wishes to keep their account, they will need to manually ask you to delete their account. In this tutorial, we'll show you how to allow users to delete their WordPress account by themselves.

allow users to delete their accounts.png

Why allow users to unsubscribe on WordPress?

Many WordPress websites allow users to register and login. These may be sites with a member's area, blogs accepting articles submitted by visiteurs or an online store.

Once users have registered their WordPress account, they cannot delete it themselves. They will have to ask you manually via a Contact form or by contacting the administrators.

Website owners may want to retain user-contributed content or at least have their email address. However, if you give users control over their information, they may feel more confident about their interactions on your Website.

That being said, let's see how to easily allow users to unsubscribe from WordPress and completely remove their information from their WordPress account.

Allow users to delete their WordPress accounts

The first thing to do is to install and activate the plugin Delete Me . For more details, see our step-by-step guide to way to install a WordPress plugin.

After activation, you must visit the page Settings »Delete Me from your WordPress admin area to configure plugin settings.

delete me plugin settings.png

You must first select the user roles that can delete their own profiles. You can also choose the link style and text that they will see on their profile page.

By default, once the account is deleted, the plugin will redirect users to your site's home page. However, you can change it and provide a custom URL for the redirect, such as a thank you page. In addition, you can also choose to delete user comments.

Don't forget to click the Save Changes button to save your settings.

You should now switch to a user account under the user roles you selected earlier. Once logged in, go to the page of profile , and you will see a new section where users can click to delete their account.

delete me profile page.png

When a user clicks on the link, they are warned that deleting an account will remove their access and all of their content. Once the user agrees, this plugin will continue and delete their account.

Adding a custom delete link to a user's profile

If you are using a custom user profile page then you can also allow users to delete their WordPress account.

Just add the following shortcode to your custom profile page template:

[plugin_delete_me]Supprimer mon compte[/plugin_delete_me]

Please note:: When a user deletes their account, they also delete all their content (posts, pages, types of personalized posts) and place them in the recycle bin.

A user can re-register a new account using the same email address, but this will not recover the content they contributed to earlier. However, as a site administrator, you can recover the contents of the recycle bin if it is not permanently deleted.

That's all for this tutorial, I hope it allowed you to add a link to delete account on WordPress site.