Post-Login Redirection in Trade Theme

Topic summary

Issue: Users want to redirect customers to the homepage instead of the default account page after login or account creation in Shopify’s Trade Theme.

Solution for Traditional Login:

  • Navigate to Admin → Online Store → Themes → Edit Code
  • Locate main-login.liquid file
  • Add <input type="hidden" name="return_to" value="/"> before the login <button> element
  • This redirects users to the homepage (/) after successful login

Alternative for Passwordless Login:
For stores using Shopify’s new passwordless/OTP authentication, use URL parameter approach:

<a href="/customer_authentication/login?return_to={{ "/pages/target" | url_encode }}">Redirect after login</a>

Note: One user couldn’t locate main-login.liquid in their theme, suggesting theme structure variations may require different approaches. The passwordless method is confirmed working with OTP login systems.

Summarized with AI on October 24. AI used: claude-sonnet-4-5-20250929.

Hi,

I need assistance with routing after user login or account creation. Currently, when a user logs in, they are directed to the Account page (https://testweb.net.au/account). I would like them to be directed to the Home page (https://testweb.net.au/) instead.

I am using the Shopify Trade Theme.

Thank you!

Hi @cup-o-flora ,

To redirect to Home Page instead of Account page, you can follow my instructions:

Step 1: Go to Admin → Online store → Themes → Edit Code:

Step 2: Search for main-login.liquid, and add the code


before the like the following picture. Save and Your site will work.

I hope these instructions will help you. If they are helpful, please give us to likes and mark as the solution.

Have a nice day sir!

1 Like

Thank you so much. I appreciate your help.

Hello!

I’m also having the same need but I cannot find the main-login.liquid you’re referring to in my theme. :disappointed_face:

Any suggestion?

If you are using the new accounts login (passwordless)

you can do this

<a href=“/customer_authentication/login?return_to={{ “/pages/target” | url_encode }}”>Redirect after login

for more info Online store customer login redirects
but I can confirm that redirect works with the new OTP login