This code used to work fine but after updating Wordpress, it doesn't seem to work anymore. I am not getting my custom link to appear. Any ideas?

function hook_lost_your_password ( $text ) {
        if ($text == 'Lost your password?'){
            $text .= '<br /><a href="/invitation/" class="neolog">Not a member? <span>Request an invitation.</span></a>';
    return $text;
add_filter( 'gettext', 'hook_lost_your_password' );

1 Answer 1


you can use wp_lostpassword_url, or you can directly echo it wherever it's required just by

<br />
<a href= "<?php echo wp_lostpassword_url(); ?>" class="neolog"><?php _e('Not a member?','text-domain'); ?> <span><?php _e('Request an invitation.','text-domain'); ?></span></a>

You can visit WordPress Codex for more info.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.