• Resolved maheshthapa04

    (@maheshthapa04)


    I have an ecommerce website running on “woocommerce 2.6.11”. Theme is storefront (official woocommerce theme). In my account page, when i click “lost your password?” link, it redirects me to “wp-login.php?action=lostpassword” earlier it used to load “/my-account/lost-password”. I am facing this problem from last 1-2 weeks. I deactivated all the plugins installed within these last 2 week, still no success.

    I have checked my WooCommerce > My Account Endpoints, Endpoint for Lost Password is lost-password.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Did you reset permalinks. Dashboard > Settings > Permalinks and “Save changes” twice.

    If that doesn’t work, try renaming .htaccess to take it out of play, then reset permalinks which will make a new one.

    If that doesn’t work, have a look for and delete any relevant wp_old_slugs in the database. Booster has an old slugs module if you don’t want to access the database directly:
    https://www.ads-software.com/plugins/woocommerce-jetpack/

    Some security plugins can mess with the login page address. If you have any installed any at any time, check through the settings and/or try temporarily deactivating it.

    If it still doesn’t work, deactivate all other plugins, whether installed recently or not, and test. If it works now, reactivate one-by-one and test.

    Thread Starter maheshthapa04

    (@maheshthapa04)

    Tried everything you mentioned. I even uninstalled all the plugins one by one, Changed the theme and still the problem is not solved.

    Thread Starter maheshthapa04

    (@maheshthapa04)

    Tried everything you mentioned. I even uninstalled all the plugins one by one, Changed the theme and still the problem is not solved.

    Please post the url to your site.

    Thread Starter maheshthapa04

    (@maheshthapa04)

    https://www.edabbewala.com/my-account/

    Clicking on the Lost Password URL. It is redirection me to /wp-login.php?action=lostpassword instead of my-account/lost-password

    It might be worthwhile quickly checking the basics again.

    Check again that at WooCommerce > My Account Endpoints, The endpoint for Lost Password is lost-password, and Save settings.

    Check that your My account page has the shortcode: [woocommerce_my_account] and that its this page that has been selected at WooCommerce > Settings > Accounts tab > My Account page dropdown. Make sure you haven’t got another My Account page in the bin.

    Make sure enable registration on the My Account page is checked.

    I’ve had a look at the markup for the lost password link. The link in the markup is the default wp-login.php? one. This means the link is going to the right place and we do not have a redirection problem. Rather, its the wrong link that’s there in the markup. This changes the problem a bit.

    The function that changes the default link to the WooCommerce one is in plugins/woocommerce/includes/wc-account-functions.php, so make sure that file exists. If you can debug function wc_lostpassword_url() starting at line 24 that would tell us where its going wrong. var_dump(); the variable on each line to see whats happening. Check the output of the var_dump() in the page markup.

    The other thing that could be happening is that the lostpassword_url filter is being hijacked by another plugin. I know you’ve tried uninstalling other plugins but that’s still a possibility. Some plugins don’t clean up after themselves fully.

    If you are not able to debug the code, I think you’ll need to deactivate all plugins except WooCommerce again. Don’t uninstall them one-by-one, just deactivate them all except WooCommerce. If you get back to the point where you have just WP, Storefront and WC in your setup, and it still doesn’t work, then it looks like you have a corrupted or incomplete install and you’ll need to consider backing up what you can, deleting the lot and starting over with a fresh database and fresh downloads. It’ll probably take less time than you have invested so far. See if anyone else chips in but I thinks that’s what you’ll need to do.

    I have WP, Storefront and WC and my lost password link is the right one!

    Thread Starter maheshthapa04

    (@maheshthapa04)

    Thanks a lot. My problem is finally resolved.
    I tried all the solutions mentioned above, i checked the wc-account-functions.php file too. But what solved my problem was deactivating the plugins.
    Earlier i deactivated one plugin at a time and then activated it. This time as you suggested I deactivated all the plugins at once then activated one by one.
    There is a plugin (Maintenance by fruitfulcode) which was creating the whole problem.
    Thanks Again ??

    I spent all day on this stupid issue, and finally figured it out!

    I had changed the “My Account” Dropdown in the WooCommerce settings (under ‘Accounts’ –> ‘Account pages’) to be my main home page (so it redirected there once someone set up an account)… But, it ended up breaking the lost-password link!

    I changed it back to ‘My Account’, which fixed it. I just have to play with the endpoints now to reflect the change so it’s not broken. Hopefully that saves someone else some time!

    I have the same problem and I totally agree with @maheshthapa04. This issue is so common. Usually caused by maintenance plugins, everyone just needs to deactivate it.

    • This reply was modified 7 years, 9 months ago by tinodo.

    @maheshthapa04 – Your post saved me! I just stumbled upon it and can’t thank you enough for posting your solution. I too am using maintenance by fruitfulcode, and woo was not playing nice with it. THANK YOU for saving me hours of frustration.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Lost Password link in My account page redirect to WordPress’ is closed to new replies.