[![How to Remove Password Recovery and Password Change from WordPress 1](https://coma.lv/wp-content/uploads/2026/01/password-reset-restriction.jpg)](https://coma.lv/wp-content/uploads/2026/01/password-reset-restriction-1030x579.jpg)

# How to Remove Password Recovery and Password Change from WordPress

Oct 7, 2025/by [Vadim Pavlovich](https://coma.lv/en/author/djcoma/)

## Why Remove Password Recovery or Password Change in WordPress

If you have enabled registration on your site, the password recovery option lets people recover lost passwords. However, in some cases you may want to remove this option for certain users. For example, if you created a temporary account for someone, or if you created a demo site that users can log in to with a demo username and password. The simplest way in this case is just to remove the password recovery link. However, some users may still have the address of the password recovery form.

## Method One: Remove the Password Recovery Option with a Plugin

The plugin method is easier and more convenient. It lets you disable password recovery for all users. You need to install and activate the Reset Password Removed plugin.

**Note:** Reset Password Removed disables password recovery for all users, including administrators.

After activation, the plugin automatically removes the “Lost your password?” link and blocks the ability to recover a password for all users.

## Method Two: Remove the Password Recovery Function in WordPress Manually

If you prefer not to install additional plugins, or want to disable password recovery selectively for certain users, you can use custom code. To do this, open any text editor and create a file, for example disable-password-reset.php. Paste one of the code options below into it.

### Disabling for All Users

**Option 1: block with a redirect and removal of the “Lost your password?” link**

The following code completely blocks password recovery for all users, removes the “Lost your password?” link on the login page and redirects anyone who tries to open the standard password reset page back to the login page:

&lt;?php add_filter( &#039;allow_password_reset&#039;, &#039;__return_false&#039; ); add_action( &#039;login_init&#039;, function() { if ( isset( $_GET[&#039;action&#039;] ) &amp;&amp; in_array( $_GET[&#039;action&#039;], [&#039;lostpassword&#039;, &#039;retrievepassword&#039;] ) ) { wp_redirect( wp_login_url(), 301 ); // Перенаправляет всех на страницу входа exit; } }); add_filter( &#039;gettext&#039;, function( $text ) { return ( $text === &#039;Lost your password?&#039; ) ? &#039;&#039; : $text; }); ?&gt;

**Option 2: block while keeping recovery available to administrators**

Another code snippet also completely blocks password recovery for all users and removes the “Lost your password?” link on the login page. Administrators will be able to recover passwords through the admin panel, while for ordinary users recovery is completely unavailable:

&lt;?php class Password_Reset_Removed { function __construct() { add_filter(&#039;show_password_fields&#039;, array($this, &#039;disable&#039;)); add_filter(&#039;allow_password_reset&#039;, array($this, &#039;disable&#039;)); add_filter(&#039;gettext&#039;, array($this, &#039;remove&#039;)); } function disable() { $userdata = wp_get_current_user(); $user = new WP_User($userdata-&gt;ID); if ( ! empty( $user-&gt;roles ) &amp;&amp; is_array( $user-&gt;roles ) &amp;&amp; $user-&gt;roles[0] == &#039;administrator&#039; ) { return true; // Администраторы сохраняют возможность восстановления через админпанель } return false; // Остальные пользователи не могут } function remove($text) { return str_replace(array(&#039;Lost your password?&#039;, &#039;Lost your password&#039;), &#039;&#039;, trim($text, &#039;?&#039;)); } } $pass_reset_removed = new Password_Reset_Removed(); ?&gt;

### Disabling for Specific Roles or Users

If you need to block password recovery only for specific roles or individual users, use code that checks roles or user IDs:

**Blocking for everyone except administrators:**

&lt;?php add_filter(&#039;allow_password_reset&#039;, function($allow, $user_id) { $user = get_userdata($user_id); if (in_array(&#039;administrator&#039;, $user-&gt;roles)) return true; // Администраторы могут сбрасывать пароль return false; // Все остальные пользователи не могут }, 10, 2); ?&gt;

**Blocking for specific users by ID:**

&lt;?php add_filter(&#039;allow_password_reset&#039;, function($allow, $user_id) { $blocked_users = [3, 7, 15]; // ID пользователей, для которых восстановление заблокировано if (in_array($user_id, $blocked_users)) return false; return true; // Остальные пользователи могут сбрасывать пароль }, 10, 2); ?&gt;

Save your file. Then connect to your site via [FTP](https://coma.lv/en/2024/08/26/what-is-ftp/) and go to the **wp-content/plugins** folder.

![WordPress](https://coma.lv/wp-content/uploads/2016/11/ftpplugindir-1.jpg)

Upload the file you created to this folder. Now go to the admin area’s **Plugins** page, where you will see the new **Disable Password Reset** plugin in the list of [installed](https://coma.lv/en/2024/08/21/how-to-install-a-plugin-in-wordpress-a-step-by-step-guide-for-beginners/) plugins. Activate it.

![WordPress](https://coma.lv/wp-content/uploads/2016/11/activateplugin-1.jpg)

After activation, password recovery will be disabled according to the chosen option: completely for all users, only for ordinary users, or for selected roles and specific users.

---

*Our specialization is WordPress website development and maintenance. Contact us for a free consultation — [vadim@coma.lv](mailto:vadim@coma.lv), [+371 29394520](tel:+37129394520)*

---
