Skip to content

Instantly share code, notes, and snippets.

@SiR-DanieL
Last active December 7, 2023 06:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SiR-DanieL/abd80494589d33149c0dd8fa27d8a28e to your computer and use it in GitHub Desktop.
Save SiR-DanieL/abd80494589d33149c0dd8fa27d8a28e to your computer and use it in GitHub Desktop.
How to Change the Continue Shopping Redirect URL
<?php
add_filter( 'woocommerce_continue_shopping_redirect', 'custom_continue_shopping_redirect' );
function custom_continue_shopping_redirect( $default ) {
//return home_url(); // Redirects to the Home page
//return wc_get_page_permalink( 'shop' ); // Redirects to the Shop page
//return get_permalink( get_option( 'page_for_posts' ) ); // Redirects to the Blog page
//return get_permalink( PAGE_ID ); // Redirects to the specific page by ID (Replace PAGE_ID with your ID
return $default; // Return to the default WooCommerce page
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment