There are times when you need to send logged out customers to a Login page and unregistered customers to a standalone Register page.
As you know, the WooCommerce My Account page, which contains the [woocommerce_my_account] shortcode, has both Login and Registration forms when registration is enabled on the My Account settings.
This is not always a good idea, mostly when you use landing pages or sales pages with a specific goal e.g. user registration.
Clearly, when this happens, you don’t want to have a login form there as well. My solution provides two new shortcodes, one for the login form and one for the register form, as well as a complete guide to set the whole process up. Enjoy!

Important Notes
As you know, the [woocommerce_my_account] shortcode is a very important one and must be kept on the WooCommerce My Account page at all costs. This means, you can’t get rid of it or delete the My Account page either.
If you want to have separate LOGIN, REGISTRATION and MY ACCOUNT pages then use this stack:
- Use [wc_reg_form_bbloomer] shortcode on the Register Page once SNIPPET #1 BELOW is active
- Use [wc_login_form_bbloomer] shortcode on the Login Page once SNIPPET #2 BELOW is active
- Keep [woocommerce_my_account ] shortcode on the My Account Page
- Add an optional registration redirection, so that customers go to the My Account page upon registration (login form already does that out of the box, the way I coded it)
- Add an optional logged in redirection – SEE SNIPPET #3 BELOW – if you don’t want to show the error message in case the customer accesses the Login or Registration pages while logged in, and redirect to the My Account page instead
- Enable “Allow customers to create an account on the “My account” page” on the “Accounts & Privacy” settings:

PHP Snippet #1: WooCommerce Customer Registration Shortcode
Place this shortcode [wc_reg_form_bbloomer] in a brand new WordPress page and the register form will magically appear. If the user is logged in, it will show a message instead.
/**
* @snippet WooCommerce User Registration Shortcode
* @how-to Get CustomizeWoo.com FREE
* @author Rodolfo Melogli
* @compatible WooCommerce 7
* @donate $9 https://businessbloomer.com/bloomer-armada/
*/
add_shortcode( 'wc_reg_form_bbloomer', 'bbloomer_separate_registration_form' );
function bbloomer_separate_registration_form() {
if ( is_user_logged_in() ) return '<p>You are already registered</p>';
ob_start();
do_action( 'woocommerce_before_customer_login_form' );
$html = wc_get_template_html( 'myaccount/form-login.php' );
$dom = new DOMDocument();
$dom->encoding = 'utf-8';
$dom->loadHTML( utf8_decode( $html ) );
$xpath = new DOMXPath( $dom );
$form = $xpath->query( '//form[contains(@class,"register")]' );
$form = $form->item( 0 );
echo $dom->saveXML( $form );
return ob_get_clean();
}
PHP Snippet #2: WooCommerce Customer Login Shortcode
Please add this shortcode [wc_login_form_bbloomer] to a brand new Login page. If the user is logged in, it will show a message instead.
/**
* @snippet WooCommerce User Login Shortcode
* @how-to Get CustomizeWoo.com FREE
* @author Rodolfo Melogli
* @compatible WooCommerce 7
* @donate $9 https://businessbloomer.com/bloomer-armada/
*/
add_shortcode( 'wc_login_form_bbloomer', 'bbloomer_separate_login_form' );
function bbloomer_separate_login_form() {
if ( is_user_logged_in() ) return '<p>You are already logged in</p>';
ob_start();
do_action( 'woocommerce_before_customer_login_form' );
woocommerce_login_form( array( 'redirect' => wc_get_page_permalink( 'myaccount' ) ) );
return ob_get_clean();
}
PHP Snippet #3: Optionally Redirect Login & Registration Pages to My Account Page If Customer Is Logged In
/**
* @snippet Redirect Login/Registration to My Account
* @how-to Get CustomizeWoo.com FREE
* @author Rodolfo Melogli
* @compatible WooCommerce 7
* @donate $9 https://businessbloomer.com/bloomer-armada/
*/
add_action( 'template_redirect', 'bbloomer_redirect_login_registration_if_logged_in' );
function bbloomer_redirect_login_registration_if_logged_in() {
if ( is_page() && is_user_logged_in() && ( has_shortcode( get_the_content(), 'wc_login_form_bbloomer' ) || has_shortcode( get_the_content(), 'wc_reg_form_bbloomer' ) ) ) {
wp_safe_redirect( wc_get_page_permalink( 'myaccount' ) );
exit;
}
}