Website Building » WooCommerce » How Do I Get Rid of Return to Shop Button in WooCommerce?

How Do I Get Rid of Return to Shop Button in WooCommerce?

Last updated on January 14, 2023 @ 3:25 am

If you’re using WooCommerce to run your online store, you may have noticed the “Return to Shop” button that appears on the cart and checkout pages. This button allows customers to return to your shop’s homepage from the cart or checkout pages.

While this button can be useful for some stores, others may want to remove it. If you’re looking to remove the “Return to Shop” button from your WooCommerce store, there are a few different ways you can do it.

PRO TIP: If you are using WooCommerce to sell products on your website, you may want to remove the “Return to Shop” button from the checkout page. This button allows customers to return to the shop page and continue shopping after they have completed their purchase. However, if you do not want customers to be able to return to the shop page, you can remove the button by following these instructions.

One way to remove the “Return to Shop” button is to add a little bit of code to your functions.php file. You can add the following code snippet to your functions.php file:

function wc_remove_return_to_shop() {
    remove_action( 'woocommerce_before_cart', 'wc_print_notices' );
}
add_action( 'init', 'wc_remove_return_to_shop' );

This code will remove the “Return to Shop” button from both the cart page and the checkout page. If you only want to remove the button from one of these pages, you can use a conditional tag to Target either the cart or checkout page. For example, if you only want to remove the “Return to Shop” button from the cart page, you can use the following code snippet:

function wc_remove_return_to_shop() {
    if ( is_cart() ) {
        remove_action( 'woocommerce_before_cart', 'wc_print_notices' );
    }
}
add_action( 'init', 'wc_remove_return_to_shop' );

Conclusion:

In conclusion, there are a few different ways that you can remove the “Return to Shop” button from your WooCommerce store. You can add a little bit of code to your functions.php file, or use a conditional tag if you only want to remove the button from one specific page.

Kathy McFarland

Kathy McFarland

Devops woman in trade, tech explorer and problem navigator.