Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #82349
    knudkp
    Participant

    I used to have a working code in functions.php that either removed or hided the ‘registre’ and ‘lost password’ link for the login page – seems that the codes i find does not work now

    Any good idears?

    thanks
    Knud

    #82378
    Mahesh
    Participant

    Hi @knudkp,

    For disabling “Register” link, go to “Dashboard=> Settings” and ‘uncheck’ “Anyone can register” in Membership. This will remove the “Register” Link.

    And for disabling the “Lost Password” link, create a child theme ( You can find the details on how to create child theme HERE ). Then in your child theme’s function.php add the following codes.

    add_filter ( 'allow_password_reset', '__return_false' );
    
    function catchbase_child_remove_password_reset_text ( $text ) { if ( $text == 'Lost your password?' ) { $text = ''; } return $text;  }
    
    function catchbase_child_remove_password_reset() { add_filter ( 'gettext', 'catchbase_child_remove_password_reset_text' ); }
    add_action ( 'login_head', 'catchbase_child_remove_password_reset' );
    
    function catchbase_child_remove_password_reset_text_in ( $text ) { return str_replace ( '<a href="http://localhost/me-prac-1/wp-login.php?action=lostpassword">Lost your password?</a>', '', $text ); }
    add_filter ( 'login_errors', 'catchbase_child_remove_password_reset_text_in' );

    Regards,
    Mahesh

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Hide registre and lost pw link from login page’ is closed to new replies.