How to disable reset password for WordPress users?

reset password
reset password

Wordpress allows you to make any possible customization, and working with Users related customizations are my personal favorite. While looking for something else, I came across this very useful filter, allow_password_reset. As the name suggests, this filter give us the option whether to allow a password to be reset for a user or not while the user tries to reset password using the reset password form. This filter allows to pass the user id as the parameter, using which you add up the desirable custom condition.

Below is a working snippet which deny password reset to all the users with subscriber’s role.

The above results in disallowing the user with subscriber role from resetting the password and the below image is what it looks like in action.

reset password error

reset password error

If you have any questions, please let me know below in the comments.


Maruti Mohanty

I am a happy go lucky WordPress Developer, who loves biking, movies and learning different languages


You may also like...

2 Responses

  1. Trimiy says:

    Bro, thanks for this post – very helpful. Working fine for my Website

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: