Redirecting customer to same page after logout in shopify store

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.


<script src=""></script>
$(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*/
return false;

Leave a comment