Shopify redirect after customers log in

Topic summary

Goal: redirect customers to a different page (e.g., homepage) immediately after logging in, without coding experience.

Proposed approach: modify the theme code to change the post-login destination.

  • Locate the line assigning the redirect: {%- assign return_to = ‘account’ | customer_return_to -%}.
  • Replace ‘account’ with the target path (e.g., ‘/’ for homepage) to become {%- assign return_to = ‘/’ | customer_return_to -%}.

Technical note: customer_return_to is a Shopify filter that sets the URL customers are sent to after authentication.

Issue encountered: the requester cannot find that code in customers/login.liquid and asks which file contains it.

Current status: no confirmed solution or file location provided; another participant asked if help is still needed.

Outcome: unresolved. Key open question: where in the theme files the return_to assignment is defined for this store’s theme.

Summarized with AI on January 25. AI used: gpt-5.

Hi guys,

I have no knowledge in coding at all, but I am trying to redirect the customers to somewhere else after they log in, for example homepage, I’ve tried the methods on the forum but I don’t think any of them are working, is there anyone that can help me on this? Thank you so much

Find the following code block:

{%- assign return_to = 'account' | customer_return_to -%}

Replace ‘account’ with the URL or handle of the page you want to redirect customers to. For example, if you want to redirect customers to the homepage, you can use ‘/’ or ‘home’ as the value. The updated code would look like this:

{%- assign return_to = '/' | customer_return_to -%}

Hi! Thank you so much for replying, however I can’t find this code {%- assign return_to = ‘account’ | customer_return_to -%} in customers/login.liquid, is it in other files?

Did you still need help with this, or you got it covered?