I want users to be redirected to the /my-account/ page after signing in. Instead, they are being redirected to the account/memberships/ page.
Initially the sign up page did not redirect anywhere and the same page just reloaded once the ‘Sign In’ button was clicked. So the user had no way of knowing if they were signed in. But I forced a redirect in the back-end using a snippet but it keeps redirecting the user to the Memberships section of their account, instead of just /my-account/ as I mentioned previously. How do I change this?
This is the snippet I am using for the forced redirect:
Thanks for the details. We tested everything in more detail, and after logging in, you are redirected to the page from which you tried to log in (i.e., if you click Sign In on the Home page, after logging in, you will be redirected to the Home page). Please make sure that you have not added any custom code that could cause this issue (perhaps you added code that provides Membership, etc., to new users immediately after registration).
As for redirects, we can provide a PHP snippet to always redirect to My Account. But please note that this may break some flows, such as the Add Listing process, etc. Let us know if this works for you.
Yes this has been an issue since the beginning. Before addition of other plugins and snippets. I can also see the redirect URL parameter, but somehow it doesn’t translate on the screen. I am not sure what’s causing it, but I am on a time crunch so I won’t be troubleshooting it now, when a small snippet can force the fix.
I also do not have any sign-up/sign-in related codes running in the backend except the one I mentioned - which I just added yesterday.
I would like a snippet to force the redirect to /my-account/ please, thank you. And if you could shed some light on which flows it may break so I will be cautious going forth.
Please try this code snippet How to add custom redirect for user after login It sets a static redirect URL for the user login form, so if you set the WooCommerce account page URL there it should work as described.