When registrations are open without purchasing any product, by default WooCommerce uses registration form on my-account page. After successful registration, users are redirected to my-account page. Might not be the best way to showcase your shop. Some user might want to redirect recently registered users to a custom page, some might consider redirecting to shop page. We can achieve this using woocommerce_registration_redirect
filter.
function careless_redirect_after_registration( $redirection_url ) {
//set redirection url
return wc_get_page_permalink( 'shop' );
}
add_filter( 'woocommerce_registration_redirect', 'careless_redirect_after_registration', 999, 1 );
If you want to redirect users to some custom page, instead of shop page, replace line 3 with return home_url( 'CUSTOM_PAGE_SLUG' );
– replace CUSTOM_PAGE_SLUG
with your actual page slug.
Code goes in the functions.php
file of your active theme.