Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi everyone!
I'd like to use the new passwordless login experience, described here: https://help.shopify.com/de/manual/customers/customer-accounts/new-customer-accounts
After login in, though, I'd like to redirect customers to a page I specify. Does anyone know, it that's possible?
I'm thinking of something like a GET parameter, that can be appended to the login URL.
e.g. https://shopify.com/XXXXXXXXXX/account ?redirect_to=/overview/
In this example, the "?redirect_to=/overview/" part would specify the target after login.
Any hints?
Best
Patrick
Hi @PatrickHeck
To change the landing url after login please follow the below steps.
Go to online-store - > edit theme search for main-login.liquid and find code
{%- form 'customer_login', novalidate: 'novalidate' -%}
now put the below line just after the above code
<input type="hidden" id="checkout_url" name="checkout_url" value="/">
value="/" refer to homepage here you can provide any URL.
Thanks @gr_trading ! But isn't main-login.liquid meant to control the classical login? (The login that needs a password)
Hi @PatrickHeck
Yes, you are right because shopify don't allow any kind of editing to login, and account flow.
Therefore if you need any design or flow change you have to switch to classic login.
Here's the most concise approach to do this:
just below this line "{%- form 'customer_login', novalidate: 'novalidate' -%}" in the login section , paste this line: "<input type="hidden" name="return_to" value="/collections">". You can replace "/collections" with the page you wanna redirect your user to after a successful login.
Will the new login experience never have abilities for customization?
Meaning... if there is anything in it that's not working for a certain store solution, is the only option to go back to classic?
I've just made the switch myself and am not fully understanding if there are *any* customization options at all.
Since you started this a few month ago, Patrick, I wonder if you can help me understand this.
Hi Linia,
thanks for contributing to this thread. However, I don't have any further information than the accepted solution contains. For general customization options, apart from the one discussed here, take a look at the manual: https://help.shopify.com/de/manual/customers/customer-accounts/new-customer-accounts.
Thanks so much for the response. Yes - I had run into that documentation while switching myself.
The documentation is helpful. I just didn't realize that the flow would be and going to the 'orders' page after login, which is quite unintuitive/problematic for my business, given the experience we need to provide clients.
The fact that there can be no customization is a bit surprising.
In any case - may end up going back to classic accounts. Thanks again for your response!
This is one of the dumbest things I've ever seen. I finally made the switch last night to the New Customer accounts. Just tested this morning, and it's taking me to an account page? No other website I've ever used does that. It takes you right back to the page you were on when you logged in. So. Dumb.
Agree. I had to switch to classic account for this functionality earlier in the year. Am revisiting this now as I really would like the frictionless login experience of 'new accounts', but also need the frictionless redirecting ability of classic accounts. Assuming from this comment in Sep that the situation still hasn't changed.
Hi @linia,
To customise the order section Shopify is working for order checkout extension permissions.
its in developer mode and allowed to build and test the apps.
Shopify is trying to stop users to polluting its theme structure by stoping the access to their key resources and making more scoping to do things using APPs only.
It is now possible to redirect to specific page after login on the new passswordless login, it is similar to the login URL you first mentioned.
You can use this link format (replace the default "/account/login" in your theme ) :
<a href="/customer_authentication/login?return_to={{ "/" | url_encode }}">Login</a>
This is working properly. thank you very much.
Will this work if I want to redirect from the profile page to the order page, all within the new customer accounts feature?
Hi @kgoslat ,
Yes, its working. We implement this to our store to enable force login to see the code and once they are logged in. It's redirecting user to its blog post.
See it in action here
https://letsdebugcode.grtrading.in/blogs/news/how-to-add-a-custom-donation-product-in-shopify
Hi, I followed your suggestion to replace /account/login with /customer_authentication/login?return_to={{ "/" | url_encode }}, but it's not redirecting to the homepage after login.
Could you please provide a step-by-step guide on exactly where to place this link in my Shopify theme?
I appreciate your help!
Hi Armin,
Which file did you modify to change the " /account/login" with "/customer_authentication/login?return_to={{ "/" | url_encode }}" ?
This is specific to the new customer accounts (Shopify Settings > Customer accounts > Customer accounts).
I have written a step by step tutorial here : https://yagisoftware.com/articles/how-to-redirect-new-customer-account-login-to-different-page
The tutorial covers official Shopify themes.
Hope this can help.
Thank you so much! Your tutorial was an absolute lifesaver, and it worked perfectly! I was able to set up the redirect successfully. I really appreciate your help—you're a legend!
It works on the desktop version. Do I need to set it up differently on mobile?
On desktop its working perfectly fine but on mobile still redirect me to account page
Hi Armin, sorry I just checked, for mobile, the drawer menu will be used, you will need to edit the "snippets/header-drawer.liquid" file, with the same step. (change routes.account_url ), hope this helps! I also updated my blog post to include this step.
Thank you thats work.
Will this method successfully redirect customers to their order page instead of the profile page when using passwordless login? I want to make sure they don’t land on the profile page. I'm not a developer, so I appreciate your explanation—it'll help me pass this along to someone who can implement it. Thanks so much for your help!
Yes, to redirect to order page (instead of homepage from my original solution), you can replace the following code :
<a href="/customer_authentication/login?return_to={{ "/" | url_encode }}">Login</a>
with this code
<a href="/customer_authentication/login?return_to={{ "/account/orders" | url_encode }}">Login</a>
(notice the "/account/orders").
Hope this helps.
Hi Soulchild37,
I have a loyalty program on my Shopify store that has a popup login button. When users log in through this popup, they are always redirected to the order page instead of returning to the previous page they were on.
Do you know how I could modify the code so that logging in through the popup also redirects users to the previous page they visited?
Thanks in advance for your help!
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025