Would you like to remove password restore option on WordPress? By default, WordPress allows users to reset / change their passwords by providing their email address. Sometimes you'll want to turn this option off on WordPress.

In this tutorial, I will show you how to disable password restore on WordPress.

Password change on WordPress

Why remove the password reset option on WordPress?

If you allow registrations on your WordPress site, then the reset option will be useful for users who have lost their password. Actually, you don't have to remove this option.

However, in some cases, you may want to remove this option for some users or roles on WordPress.

For example, if you created a temporary account for one person or if you created a demo account that users can use (with basic identifiers that should not be changed).

The easiest solution would be to just delete the reset link. But some users might already know the URL to restore an account.

That being said, let's see how easily disable the password reset option on WordPress.

Method One: Disable Password Restore Using a WordPress Plugin

This method is better and easier. It allows you to disable password reset on WordPress for specific user roles or even for some users.

This way, you can control access to this feature that you can reserve only for trusted users.

The first thing you need to do is to install and activate the plugin " Plainview Protect passwords ". For more details, you can discover how to install a WordPress plugin.

After activating the plugin, all you have to do is visit the page " Settings> Protect Passwords To configure the plugin.

protect-password-settings plugin WordPress

From there, you simply need to select the role where the individual user whose password restore function you want to disable.

There is also an option to exclude certain users. This option is particularly useful if you want to keep the password restore option yourself (For your account).

Do not forget to click on " Save Changes To change the settings of your shop.

You can see the plugin in action by trying to click on " Lost Password ? ". This will take you to the reset page where you can specify the email address or username for which you want to change the password.

You will notice an error that will tell you that this option has been disabled for this specific user.

Password protection notification

Method two: How to turn off reset passwords option manually

This method requires you to add code to your WordPress site. It is not recommended who do not have experience in web development. Remember we showed you how to create a WordPress plugin.

All you have to do is add the following piece of code to your plugin:

class Password_Reset_Removed {function __construct () {add_filter ('show_password_fields', array ($ this, 'disable')); add_filter ('allow_password_reset', array ($ this, 'disable')); add_filter ('gettext', array ($ this, 'remove')); } function disable () {if (is_admin ()) {$ userdata = wp_get_current_user (); $ user = new WP_User ($ userdata-> ID); if (! empty ($ user-> roles) && is_array ($ user-> roles) && $ user-> roles [0] == 'administrator') return true; } return false; } function remove ($ text) {return str_replace (array ('Lost your password?', 'Lost your password'), '', trim ($ text, '?')); }} $ pass_reset_removed = new Password_Reset_Removed ();

Once you are done editing, all you need to do is install your plugin on your WordPress blog. The procedure to follow is the same as all other plugins.

You can also use an FTP client to send your website on line. Once done, make sure to activate your plugin. That's all. The flaw with this method is that the password reset option is disabled for everyone.

That's it for this tutorial. I hope it will be of great use to you. Do not hesitate to contact us for further clarification.