Redirecting Customer to Same Page After Logout in Shopify Store
Shopify · User Experience

Redirecting Customer to Same Page After Logout in Shopify Store

Aashish Kasma|February 3, 2018|1 Minute read|Listen
ShopifyUser Experience
TL;DR

Shopify merchants often face the challenge of being redirected to the homepage after logout. Here we offer a simple solution to auto-redirect customers back to the same page or a specific collection page. By adding a small jQuery script, you can easily achieve this desired functionality and enhance the user experience on your Shopify store.

`

$(document).ready( function() { $('a[href^="/account/logout"]').on("click", function() { $.ajax( $(this).attr('href') ) .done(function() { /* Here you can perform required things to achieve  i.e. redirect to specific url, reload same page*/ window.location.reload();

}); return false; }); }); `

This feature was requested by several Shopify merchant to auto-redirect to the same page.

Shopify is redirecting customers to homepage or landing page or index page after logout.

But as requested by several clients, We have played with code and achieve a very simple way to redirect the customers to same page or specific collection page,

Just add this simple line of text to achieve this, We are assuming that jquery is already added by most of the themes.

SHARE

Aashish Kasma
Aashish Kasma
Co-founder & CTO, Lucent Innovation
linkedinmediumdevtohashnode

Facing a Challenge? Let's Talk.

Whether it's AI, data engineering, or commerce tell us what's not working yet. Our team will respond within 1 business day.

Start the Conversation

Share your requirements

(+1)

Our Global Footprint

With offices in the USA and India, we partner with businesses around the world.

Lucent Innovation

Engineering Partners. Not Vendors.

Certified Databricks Partner & Shopify Plus Agency delivering production-grade data, AI, and Commerce solutions since 2013.

Follow Us

Get in Touch
Databricks PartnerShopify Plus PartnerISO Certified

Lucent Innovation, © 2026. All rights reserved.