Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @ailaina123456,

    Forminator uses the default WP form. You can use the following hook to change the password link:

    <?php
    
    add_filter( 'lostpassword_url',  'change_lostpassword_url', 10, 0 );
    function change_lostpassword_url() {
        return site_url('/password-page/');
    }

    Where the line:
    return site_url('/password-page/');

    Will change the URL to /password-page. Suppose the site is abc.com, then the above will change to abc.com/password-page.

    You can implement the above code as a mu-plugins.

    Please check this link on how to implement the above code as a mu-plugins:
    https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins

    Best Regards,

    Nithin

    Thread Starter ailaina123456

    (@ailaina123456)

    Hi,

    I have implemented all the steps mentioned and created the php file, however, the error message in the form with the link lost password still redirects to a page /lost-password

    https://prnt.sc/HwgSXbF7bhm1

    Thanks for your quick feedback

    Regards

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @ailaina123456,

    Just to be sure it’ll only change the link for the following error message as shown in your previous screenshot, ie

    https://prnt.sc/GmgTUG4dxprP

    The “Lost Password” which appears by default in the login form ie the following one:

    Screenshot at 19:34:15.png

    The above is added within the “Password” field ie:

    Screenshot at 19:34:48.png

    Maybe that’s what you are checking? Other than that I can confirm the given code works when the “Error” message appears when tested on my site.

    Possible to share the URL to the page where you have the login form, so that we could have a better idea?

    Looking forward to your response.

    Kind Regards,

    Nithin

    Thread Starter ailaina123456

    (@ailaina123456)

    Hi,

    I have tried again and it is still not working it still leads to the lost passwor page

    The page is tejomaia.com/find-a-retreat to get to the form click on the link “I already have a host account” in the left sidebar widget on desktop or in footer sidebar on mobile.

    If ever nothing works, is it possible to hide the link in the error message and change the error message text?

    Thanks for your quick reply

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @ailaina123456

    The solution suggested by my colleague earlier here

    https://www.ads-software.com/support/topic/lost-password-error-message-link/#post-16521167

    should work just fine if applied correctly. I’m not sure how did you add the code exactly but there’s an easy way to confirm that it’s not working: go to the tejomaia.com/wp-admin page (when you are NOT logged-in) and you would see a standard login form; if you hover over the “lost password” link there you will also see that it is not changed.

    The code that my colleague shared would change it and this would also make it changed in the error message. I have tested it right now with your form (that you shared in your other ticket which I responded to) and it works as expected.

    So getting back to the code, did you add it as MU plugin?:

    – create an empty file with a .php extension (e.g. “change-lost-passsword-link.php”)
    – copy and paste code into it exactly as given

    <?php
    
    add_filter( 'lostpassword_url',  'change_lostpassword_url', 10, 0 );
    function change_lostpassword_url() {
        return site_url('/password-page/');
    }

    – save the file
    – upload the file (using FTP or cPanel File Manager or similar way) to the “/wp-content/mu-plugins” folder of your site’s WordPress installation

    It’s important to add the code this way and it should then work out of the box, though you may need to clear all cache on site/server.

    Kind regards,
    Adam

    Thread Starter ailaina123456

    (@ailaina123456)

    Hi,

    The plugin appears in the mu plugins on the admin plugins list

    https://prnt.sc/dB4PJFIIe2g8

    Below is the code of the mu-plugin, the page slug is password-reset.

    https://prnt.sc/j59oCI_AyUH8

    Do no why it is not working

    Regards

    Thread Starter ailaina123456

    (@ailaina123456)

    I have recreated the php file:

    https://prnt.sc/ePVuTEsbA64D

    I don’t have any cache plugin activated on the website, how to clear the server’s cache?

    Thanks

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @ailaina123456

    I’m not able to tell you exactly how to clear server-side cache (if there is any at all) because it is different at different hosts. If you’re not sure if there is any server-side and how to clear it, please contact your host support and ask them for advise on that.

    However, there is one other thing worth checking. It is possible that “something” on site is “overriding” this code so please try replacing number 10 in this line

    add_filter( 'lostpassword_url', 'change_lostpassword_url', 10, 0 );

    with a higher number, like 99 or even 101, like this

    add_filter( 'lostpassword_url', 'change_lostpassword_url', 101, 0 );

    You can even try e.g. 9999. This would cause this code to be “executed later” and if anything is overriding it, this change should help.

    Give it a try, please, and let us know about result.

    Kind regards
    Adam

    Thread Starter ailaina123456

    (@ailaina123456)

    Thanks Adam for your suggestion! it was the reason, it is working fine now ??

    Have a nice day!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Lost password error message link’ is closed to new replies.