Title: Remove &#8220;Forgot Username&#8221; Link
Last modified: November 14, 2017

---

# Remove “Forgot Username” Link

 *  Resolved [svacontact](https://wordpress.org/support/users/svacontact/)
 * (@svacontact)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/remove-forgot-username-link/)
 * Hi,
    Great plugin. I would like to remove the link to retrieve the username from
   the password-reset page. I still want to allow password resets, but not username
   lookups from email addresses. I have poked around the code a bit, but this seems
   like something that could easily get messed up or cause unintended consequences.
   I’m probably overlooking something simple. Can you please help with this? Thanks.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fremove-forgot-username-link%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [svacontact](https://wordpress.org/support/users/svacontact/)
 * (@svacontact)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/remove-forgot-username-link/#post-9735218)
 * Found a solution to this although I’m sure there is a more elegant way. Inserted
   this PHP code to override the username lookup link:
 * add_filter( ‘wpmem_username_link_str’, ‘my_username_link_str’, 10, 2 );
    function
   my_username_link_str( $str, $link ) { return “<font color=red>Please use the 
   Contact Form if you have forgotten your Username</font>”; }
 * This still left the possibility of direct URL access, so I handled that with 
   an htaccess rule. Based on another support post, I also blocked direct access
   to the password change URL with htaccess.
 * BTW, the reason I asked about this is that I was getting quite a few really annoying
   password reset attempts from non-members. I’m hopeful that forcing the use of
   a Contact Form to retrieve the username will curtail a lot of this.
 *  Plugin Author [Chad Butler](https://wordpress.org/support/users/cbutlerjr/)
 * (@cbutlerjr)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/remove-forgot-username-link/#post-9753790)
 * I hadn’t really worked in the possibility of removing the forgot username link,
   so it’s a new thought (but a good one – like everything else in the plugin, there
   should be at least one way to change it).
 * I’ve noted this in the development list for the 3.2 release to review.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Remove “Forgot Username” Link’ is closed to new replies.

 * ![](https://ps.w.org/wp-members/assets/icon-256x256.png?rev=1226414)
 * [WP-Members Membership Plugin](https://wordpress.org/plugins/wp-members/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-members/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-members/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-members/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-members/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-members/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Chad Butler](https://wordpress.org/support/users/cbutlerjr/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/remove-forgot-username-link/#post-9753790)
 * Status: resolved