Do you want to allow users to delete their own WordPress accounts?
If you allow user registration on your WordPress site, and a user does not want to keep their account anymore, then they will have to manually ask you to delete it.
In this article, we will show you how to easily allow users to delete their WordPress account from their account area.
Why Allow Users to Unregister Themselves in WordPress?
Many WordPress websites allow users to register. These could be membership websites, blogs that accept user-submitted posts, or an online store.
However, once users register their WordPress account, they cannot delete it on their own. They will have to manually ask you through a contact form to delete their information.
Website owners may want to keep the user-contributed content or at least have their email addresses. However, if you give users control of their information, then they may feel more confident in their interactions on your WordPress website.
That being said, let’s see how to easily allow users to unregister themselves in WordPress and delete their WordPress account information completely.
How to Allow Users to Delete Their WordPress Accounts
First, you need to install and activate the Delete Me plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.
Upon activation, head over to the Settings » Delete Me page from the WordPress admin sidebar to configure the plugin settings.
From here, you can start by checking the boxes next to the user roles that can delete their accounts.
For example, if you want authors to be able to delete their own accounts, then you can check the box next to that option.
Next, scroll down to the ‘Your Profile’ section to choose link styling and text that the user roles will see on their profile page.
For example, you can add a heading, a warning message, and a URL for the page that users will be redirected to upon deleting their accounts.
After that, scroll down to the ‘Miscellaneous’ section on the page.
From here, you can check the ‘Delete Comments’ option if you want the comments added by the user to be automatically deleted from your website upon account deletion.
You can also check the ‘E-mail Notification’ option if you want to receive an email with account deletion details every time a user deletes their account.
Keep in mind that this email will be sent to the administrator’s email address.
Finally, click the ‘Save Changes’ button to store your settings.
Now you will need to switch to a user account with the user roles you selected earlier.
Once logged in, go ahead and visit the Profile page, and you will see a new section where users can click to delete their account.
When a user clicks on the link, they will be shown a warning that deleting an account will delete their access and all their content.
Once the user agrees, this plugin will proceed and delete their account.
Adding Delete Account Link to Custom User Profile Page
If you use a custom user profile page, then this is how you can allow users to delete their WordPress accounts.
Simply add the following shortcode to your custom profile page template:
[plugin_delete_me]Delete Your Account[/plugin_delete_me]
Note: When a user deletes their account, it will also delete all their content (posts, pages, custom post types) and move it to the trash.
A user can re-register a new account using the same email address, but this will not recover the content they contributed earlier. However, as a site administrator, you can recover content from trash if it is not permanently deleted.
For detailed instructions, you may want to see our beginner’s guide on how to recover and restore deleted pages in WordPress.
We hope this article helped you learn how to allow users to delete their accounts in WordPress. You may also want to see our step-by-step WordPress security guide for beginners and our top picks for the best WordPress plugins to help grow your site.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Stacey Beckles says
I am not tech-savvy and currently trying to build a website. This blog has been very helpful. Any question I may have I am sure to find something here. Thank you for all your hard work and keep up the good job.
WPBeginner Support says
You’re welcome, glad you’ve found our content helpful
Admin
Swayam says
It does not delets the custom post type using in box directory theme