Reserve Your Free Seat for Our Next WooCommerce Class! Search
Business Bloomer
  • Business Bloomer Club
  • WooCommerce Plugins
  • WooCommerce Tips
  • Log In
  • 0
  • Business Bloomer Club
  • WooCommerce Plugins
  • WooCommerce Tips
  • Log In
  • Search
  • Contact
  • Cart
WooCommerce Code Snippets Customer Login Customer Registration My Account

WooCommerce: Separate Login, Registration, My Account Pages

Last Revised: Aug 2024

STAY UPDATED

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!

Here are new shortcodes to display WooCommerce Login and Registration forms separately on custom pages!

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:

  1. Use [wc_reg_form_bbloomer] shortcode on the Register Page once SNIPPET #1 BELOW is active
  2. Use [wc_login_form_bbloomer] shortcode on the Login Page once SNIPPET #2 BELOW is active
  3. Keep [woocommerce_my_account ] shortcode on the My Account Page
  4. 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)
  5. 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
  6. Enable “Allow customers to create an account on the “My account” page” on the “Accounts & Privacy” settings:
Please enable registrations from the “My Account” page

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        businessbloomer.com/woocommerce-customization
 * @author        Rodolfo Melogli, Business Bloomer
 * @compatible    WooCommerce 9
 * @community     https://businessbloomer.com/club/
 */
  
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->saveHTML( $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        businessbloomer.com/woocommerce-customization
 * @author        Rodolfo Melogli, Business Bloomer
 * @compatible    WooCommerce 9
 * @community     https://businessbloomer.com/club/
 */
 
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        businessbloomer.com/woocommerce-customization
 * @author        Rodolfo Melogli, Business Bloomer
 * @compatible    WooCommerce 9
 * @community     https://businessbloomer.com/club/
 */

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;
    }
}

Where to add custom code?

You should place custom PHP in functions.php and custom CSS in style.css of your child theme: where to place WooCommerce customization?

This code still works, unless you report otherwise. To exclude conflicts, temporarily switch to the Storefront theme, disable all plugins except WooCommerce, and test the snippet again: WooCommerce troubleshooting 101

Related content

  • WooCommerce: Add New Tab @ My Account Page
    One of the features of Business Bloomer Club is the provision of Premium WooCommerce Q&A Support to supporters who enroll. So, how to add an…
  • WooCommerce: How To Make A Website GDPR Compliant? (12 Steps)
    Ok, we all know that the EU General Data Protection Regulation (GDPR) will come into force on the 25th May 2018. So the main question…
  • WooCommerce Visual Hook Guide: My Account Pages
    Hey WooCustomizers, the Visual Hook Guide is back 🙂 In this episode, I’ve created a visual HTML hook guide for the WooCommerce Account Pages (there…
  • WooCommerce: Add First & Last Name to My Account Register Form
    Here’s yet another useful PHP snippet – and a mini-plugin alternative with super simple settings – that adds the Billing First Name and Billing Last…
  • WooCommerce: Allow Users to Edit Processing Orders
    How can WooCommerce customers edit an order they just placed and paid for? I swear I looked on search engine results and other places before…

Rodolfo Melogli

Business Bloomer Founder

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza. Follow @rmelogli

234 thoughts on “WooCommerce: Separate Login, Registration, My Account Pages”

  1. Jason Cohen
    April 14, 2025

    The snippets work great for me.

    I have only one question: how do I customize woocommerce_login_form ? I only need it to say “email” (not username or email)

    Thanks!

    Reply
    1. Rodolfo Melogli
      April 18, 2025

      Great! You can “translate” any string, such as this label, with https://www.businessbloomer.com/translate-single-string-woocommerce-wordpress/

      Reply
      1. Erika Laguna
        May 7, 2025

        Thank you!

        I am still having issues with the Registration form. I am using only snippet 1 but I am also using some of your other snippets for creating a checkbox, validating it and saving it.

        1. the new Registration form works great but the validation messages are not showing at all. The form is not being sent, it just sits there.
        2. the first and last name are supposed to be mandatories, but I can send the form without any validation to them. The form is only validating email and password.
        3. the new field I created in the registration form is somehow interfering with checkout, meaning, when I try to checkout, the new field validation message shows there! and it doesn’t let me checkout.
        4. I have a login/register before-checkout popup plugin in place, and the validation for the new checkbox that is NOT in their form is also showing there, not allowing me to register

        Reply
        1. Rodolfo Melogli
          May 15, 2025

          Thank you Erika! Unfortunately this looks like custom troubleshooting work and I cannot help here via the blog comments. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding! ~R

          Reply
  2. Emam
    January 18, 2025

    PHP Snippet #1: Error

    Warning: DOMDocument::loadHTML(): Tag wc-order-attribution-inputs invalid in Entity, line: 57 in /home/clients/a6f04aac48c5cfb7f448c84f298af395/sites/mysite.example/wp-content/plugins/insert-headers-and-footers/includes/class-wpcode-snippet-execute.php(419) : eval()’d code on line 18

    Reply
    1. Rodolfo Melogli
      January 25, 2025

      Does this happen even if you place the code in a custom plugin or child theme instead of Code Snippets?

      Reply
      1. Ivailo
        April 9, 2025

        Hello!
        Since I’m new here, first I want to congratulate Rodolfo for the great tips and codes he creates!
        I got the same error as Emam and decided to ask Chat GPT for an explanation and correction. Here is the answer of the AI and the corrected code that works perfectly.

        ✅ Problem: DOMDocument Warning in WordPress with WooCommerce
        When using DOMDocument::loadHTML() in a WordPress shortcode or snippet (especially related to WooCommerce templates), you may encounter the following warning:
        Warning: DOMDocument::loadHTML(): Tag wc-order-attribution-inputs invalid in Entity, line: 57 in …snippet-ops.php on line 18

        Explanation:
        This happens because DOMDocument is very strict with HTML parsing and throws warnings when it encounters non-standard HTML tags, such as used by WooCommerce or other plugins.
        Also, if you’re dealing with non-Latin characters (e.g. Cyrillic), DOMDocument may mess up the encoding and display broken characters — unless you explicitly tell it to use UTF-8.

        ️ Solution:
        You can fix this in three steps:
        Suppress warnings from DOMDocument using libxml_use_internal_errors(true).
        Set UTF-8 encoding properly to avoid broken characters.
        Safely extract the registration form from the WooCommerce login template.

        ✅ Final Working Snippet (UTF-8 + No Warnings):

        /**
         * @snippet       WooCommerce User Registration Shortcode
         * @how-to        businessbloomer.com/woocommerce-customization
         * @author        Rodolfo Melogli, Business Bloomer
         * @compatible    WooCommerce 9
         * @community     https://businessbloomer.com/club/
         */
        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' );
            // Add XML header to force UTF-8
            $html = '<?xml encoding="UTF-8">' . $html;
            // Suppress DOMDocument warnings
            libxml_use_internal_errors(true);
            $dom = new DOMDocument();
            $dom->encoding = 'UTF-8';
            $dom->loadHTML( $html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD );
            libxml_clear_errors();
            $xpath = new DOMXPath( $dom );
            $form = $xpath->query( '//form[contains(@class,"register")]' );
            $form = $form->item( 0 );
            echo $form ? $dom->saveHTML( $form ) : '<p>Registration form not found.</p>';
            return ob_get_clean();
        }
         

        Result:
        No more DOMDocument warnings.
        Proper UTF-8 rendering (Cyrillic and other non-Latin characters work perfectly).
        Safe extraction of the WooCommerce registration form for use in a custom shortcode.

        Reply
        1. Rodolfo Melogli
          April 18, 2025

          Much appreciated!

          Reply
  3. denis
    January 15, 2025

    Hi Rodolfo,

    I’ve been using Snippet #2 for the past year on a client’s site, to redirect members to a Members-Only page after login . It’s been working great.

    However the redirect doesn’t seem to work after updating to WooCommerce 9.5 — users are redirected to the Home page. Did something change?

    Could a caching issue be involved?

    Reply
    1. Rodolfo Melogli
      January 18, 2025

      I don’t think so. Do you also use Snippet #3?

      Reply
  4. cgray
    October 3, 2024

    Hi Rodolfo,

    This is amazing trick, and I would really appreciate that you share this.
    The code works greatly well, however, when I activate the third code block, Elementor cannot open the page contains the shortcode. Could you please share any thought or comment to fix this?

    I implemented debug process like deactivating plugins and stuff but nothing was really went out of the rail. If you could share your knowledge just a little bit, I would greatly appreciate it.

    p.s. One of your reply on random question in this post like “sorry, works on mine.” is real good one. I literally laughed so hard

    Reply
    1. Rodolfo Melogli
      October 11, 2024

      Hello there! Weird, did you change some of snippet #3 or did you use the exact same?

      Reply
  5. nevo
    August 18, 2024

    hey ! i did all the steps as the guide says:
    1. i created a login page with the [wc_login_form_bbloomer] shortcode
    2. i created a registration page with the [wc_reg_form_bbloomer] shordcode
    3.i added the PHP Snippet: Redirect Registered Customers to Custom URL @ My Account Page.
    finally added all the 3 snippers to function.php
    but nothing is happens, when i press the account button – where are still 2 forms login and sign up.
    am im doing something wrong?
    will be happy to get advice. thanks ahead!

    Reply
    1. Rodolfo Melogli
      August 27, 2024

      I guess the My Account page for logged out users needs to be hidden, and you need to send them to the Login or Registration page instead?

      Reply
  6. Daniel S.
    May 28, 2024

    Hey! I’ve been using this code for some time and it always worked great.
    For some reason now the register button wont appear anymore on the register page. I can see the input field (to write the email address), but the button itself is missing. I also notice that: 1) the button still appears normally on the default my-account page; and 2) i can still see the button in the register page’s source-code. What could be the reason for such behavior? Thanks a lot!

    Reply
    1. Rodolfo Melogli
      May 31, 2024

      Sounds like a plugin conflict to me?

      Reply
      1. alex4e
        June 4, 2024

        Hey,
        I was able to track down the problem. It comes from the woo feature Order Attribution (Woocommerce > Settings > Advanced > Features). It adds tag inside registration, login and checkout forms. And it looks like the $dom->loadHTML not supported HTML5 elements. The exact error is “Warning: DOMDocument::loadHTML(): Tag wc-order-attribution-inputs invalid in Entity”.
        So, if you turn off the Order Attribution feature everything work as usual.

        Rodolfo, is there any workaround that will work with this feature, because it is really useful? Thank you!

        Reply
        1. Rodolfo Melogli
          June 12, 2024

          Try with this fix: https://www.businessbloomer.com/woocommerce-separate-login-registration/#comment-1017086

          Reply
          1. JD
            August 1, 2024

            Awesome. Came here just today top say this happened with the Woo updates past 8.7.1. So great to see the blog other, commenter, and community working together actively. This one had my head beating the wall today, that is for sure!

            Reply
            1. Rodolfo Melogli
              August 2, 2024

              Great!

              Reply
  7. Mark
    May 20, 2024

    I seem to have an issue with the Customer Registration form in the latest version of WooCommerce (8.8.3). The register button isn’t displaying. It seems to appear for a split second as the page loads and then disappears. Rolling back to an older version of WooCommerce that I knew worked ok (8.6.1) seemed to fix it and the Register button reappeared.

    Reply
    1. Rodolfo Melogli
      May 31, 2024

      Not sure, sorry!

      Reply
      1. Ashiquer
        June 4, 2024

        it’s the same problem for me. using the latest WC 8.9.1 and the registration form is not displaying properly.

        Reply
        1. Rodolfo Melogli
          June 12, 2024

          See https://www.businessbloomer.com/woocommerce-separate-login-registration/#comment-1017086 and let me know!

          Reply
      2. ark
        June 4, 2024

        I found the solution with the help of AI, if you update the

         echo $dom->saveXML( $form );
        to
        echo $dom->saveHTML($form);
        

        then the form is displaying properly again.

        Reply
        1. Rodolfo Melogli
          June 12, 2024

          Nice, thank you!

          Reply
  8. Red
    February 3, 2024

    Hello, the code works perfectly fine for me, many thanks for your help, but if I try to place a reCAPTCHA or Cloudflare’s turnstile on the registration page, I encounter an issue.

    The captcha/turnstile appears on the login page created for the code, for the original my-account page of WooCommerce (the message appears below the login section and the create an account section), but on the register account page created for the code, the captcha/turnstile does not appear at all.

    Any idea on how to resolve this issue?

    Reply
    1. Rodolfo Melogli
      February 16, 2024

      Hello Red, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  9. Enrico
    May 16, 2023

    Hi, can i change or redirect the path to the lost-password-page on the login-page

    Reply
    1. Rodolfo Melogli
      May 19, 2023

      That can be done with a redirect maybe?

      Reply
  10. Eric Gauvin
    May 16, 2023

    Hi again,

    For the password strength meter I was able to get it working by enqueing the javascript on this page

    
    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 '<div class="woocommerce">';
       echo $dom->saveXML( $form );
       echo '</div>';
       wp_enqueue_script( 'wc-password-strength-meter' );
       return ob_get_clean();
    }
    
    

    Not sure if there’s a cleaner, better way to do this.

    Thanks again for these snippets.

    Reply
    1. Rodolfo Melogli
      May 19, 2023

      Nice!

      Reply
  11. Eric Gauvin
    May 16, 2023

    Hi again, Regarding the show/hide password icon, it looks like the form needs to be inside a div for the javascript to work:

    echo '<div class="woocommerce ct-woo-unauthorized">';
    woocommerce_login_form( array( 'redirect' => wc_get_page_permalink( 'myaccount' ) ) );
    echo '</div>';
    

    I added this around my shortcode and now it’s displaying the icon.

    Reply
    1. Rodolfo Melogli
      May 19, 2023

      Thank you!

      Reply
  12. Fredrick
    May 6, 2023

    Thanks alot for these codes. It has helped me reduced some plugins from my project

    but I have a useful request to make

    will it it possible to add redirect url to these shortcodes?
    For EXAMPLE :
    [wc_reg_form_bbloomer redirect=”page_url”] to direct user to that page after registration
    or [wc_login_form_bbloomer redirect=”shop_url”] to direct users to shop page after login

    this way, it will be possible to use different login and register forms for different purposes on a particular website

    Reply
    1. Rodolfo Melogli
      May 9, 2023

      One of the snippets is exactly about that, please read the whole tutorial

      Reply
  13. Simon
    May 3, 2023

    Thank you! there is one issue that I detected, when user insert already registred email in the register form and he get the error message “Error: An account is already registered with your email address. Please log in.”

    The link “Please log in” is not working and not redirect to the login page.

    Reply
    1. Rodolfo Melogli
      May 9, 2023

      You’re right. The “please log in” link requires a JS listener to toggle the login form, which is not on the custom registration page, but can only be found on the default checkout. I’ll see what I can do about that

      Reply
      1. Marcelle
        May 13, 2023

        I”m also looking for a solution to this. The link stays on the same page as the page contains both login and register forms.

        Reply
  14. Samir
    March 22, 2023

    Hi, everything works like a charm.

    However, after logging out, it redirects the user to the original WooCommerce My Account page.

    Wondering if you could help creating a code to redirect users to another url?

    Many thanks!

    Reply
    1. Rodolfo Melogli
      March 23, 2023

      Ok, I’ll post a tutorial next week!

      Reply
      1. Dav
        April 20, 2023

        Was there an updates on that?
        Thanks!

        Reply
        1. Rodolfo Melogli
          April 25, 2023

          https://www.businessbloomer.com/woocommerce-logout-redirect-my-account/

          Reply
          1. simon
            May 3, 2023

            I tried the snippet inside the link you have shared. but it’s not working, after user log out it’s redirect to the regular my account page and shows login & register forms

            Reply
            1. Rodolfo Melogli
              May 9, 2023

              Works perfectly for me. Where did you try to log out from?

              Reply
  15. Daniel
    March 20, 2023

    Hey, I have added the snippets to my woocommerce store and they are working fine. There is one problem though, the ‘register’ page won’t show any special characters, like ç and á, which are como in my language (Portuguese), replacing them by symbols like ç and á. Please, does anyone know to fix this? I found out that it may be related to the use of the saveXML( ) and that it have some character encoding problems, but I can’t figure out how to fix the issue. I tried to post in here before, but my post never showed up in the page. Thank you all for your help. Best

    Reply
    1. Rodolfo Melogli
      March 20, 2023

      I see. Do you have a screenshot for me?

      Reply
      1. Rodolfo Melogli
        March 20, 2023

        In the meanwhile, try this new version (I added UTF8 encoding)

        Reply
        1. Daniel
          March 20, 2023

          Hey Rodolfo, thank you very much for your answer. Your suggestion solved the problem completely.
          Great code! Thank you again! Best

          Reply
          1. Rodolfo Melogli
            March 23, 2023

            Excellent!

            Reply
        2. Tomas Rachmančiukas
          March 21, 2023

          Same problem here with encoding aswell

          Reply
          1. Rodolfo Melogli
            March 23, 2023

            Did you try the revised version?

            Reply
            1. Tomas Rachmančiukas
              March 23, 2023

              This helped for me

              $html = wc_get_template_html( 'myaccount/form-login.php' );
              $html = mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8');
              $dom = new DOMDocument();
              $dom-&gt;encoding = 'utf-8';
              $dom-&gt;loadHTML( $html );
              $xpath = new DOMXPath( $dom );
              $form = $xpath-&gt;query( '//form[contains(@class,"register")]' );
              $form = $form-&gt;item( 0 );
              
              Reply
              1. Rodolfo Melogli
                March 30, 2023

                Cool

                Reply
  16. Daniel
    March 17, 2023

    Hey, I’ve just added these codes to my page and they work fine. There is only one problem: snippet code 1 does not take in consideration the character encoding, and every special character in other languages, like ç and á in the registration page’s text becomes all messy… Is there a quick fix for that? Thank you very much for the codes and for any insights on this issue.

    Reply
  17. Venus
    February 7, 2023

    Hi

    I followed your instructions and the login page works but for the registration page nothing happens when I choose to register me as a vendor (no extend sections like the default [woocommerce_my_account] appears and nothing happens when I press the register button. I wasn’t redirect to any pages, not even any error page).

    Thanks!

    Reply
    1. Rodolfo Melogli
      February 28, 2023

      This tutorial is for a default WooCommerce install – making it compatible with a third party multi-vendor plugin may require additional code.

      Reply
  18. KJCheon
    January 7, 2023

    Hi, I use the shortcode [wc_reg_form_bbloomer] for the user registration form. And it works fine when registering as a normal member . But registering as a vondor, mercado multivendor plugin, error message “First name is required!”. The registration form fields are the same. Would you kindly guide me why and how I can fix this vendor registeration error?

    Reply
    1. Rodolfo Melogli
      January 13, 2023

      KJ, thanks so much for your comment! Unfortunately this looks like custom troubleshooting work and I cannot help here via the blog comments. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding! ~R

      Reply
  19. Pavan
    December 9, 2022

    Hi,

    PHP Snippet #2: Separate WooCommerce Login Form Shortcode:

    Login form does not show the error when logging in with wrong details.

    Please let me know how to make the error to appear.

    Thanks

    Reply
    1. Rodolfo Melogli
      December 16, 2022

      Ok thank you. I’ve revised the snippet, let me know

      Reply
  20. surya
    November 12, 2022

    i am not getting error messages on login page..i have used the code mentioned in comments but not working for me..

    everything is working fine except error messages not showing on login page..

    Reply
    1. Rodolfo Melogli
      November 30, 2022

      Works for me https://www.screencast.com/t/6pEZomuTUur – please check again and do the usual troubleshooting steps

      Reply
      1. Pavan
        December 9, 2022

        @surya mentioned it was for ‘Login’ page, not for ‘Register’ page.

        Reply
        1. Rodolfo Melogli
          December 16, 2022

          Ok thank you. I’ve revised the snippet, let me know if it works

          Reply
  21. Alex
    November 1, 2022

    Hi,
    thanks for your help but i have a problem.
    Unfortunately, if the user accidentally enters the registration page to log in (so he already has an account) with your code, this woocommerce error message does not appear: “Error: An account with this email address has already been registered. Log in “.

    Reply
    1. Rodolfo Melogli
      November 30, 2022

      Works for me https://www.screencast.com/t/6pEZomuTUur – please check again and do the usual troubleshooting steps

      Reply
  22. Mohammad Kashif
    May 9, 2022

    Can i only separate My Account Page?
    Like Login and Registration have same shortcode and My Account Page different shortcode.

    Thanks

    Reply
    1. Rodolfo Melogli
      May 15, 2022

      Hi Mohammad, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
      1. Mohammad Kashif
        May 26, 2022

        Submitted!

        Reply
  23. Oumaima
    April 23, 2022

    I used code snippets plugin to add the two snippets and then I added two pages login and register in which I put the shortcodes but nothing is showing up, can you help me find out what is the problem and how to fixe it

    Reply
    1. Rodolfo Melogli
      May 1, 2022

      Hello Oumaima! Can I ask you to disable all plugins but Woo & Code Snippets, and also to temporarily switch theme, and see if everything works ok?

      Reply
  24. Praveen
    March 9, 2022

    Hey the code works but the alignment of some fields are off, like all the names of fields are in line but the boxes are based on how long the label is and are not lining up so it doesn’t look good. Is there an easy fix to this? Thank you

    Reply
    1. Rodolfo Melogli
      March 25, 2022

      Hey Praveen, yes there is an easy fix, but you’ll need custom CSS for this, as it depends on your theme

      Reply
  25. Dip
    February 18, 2022

    Hi there, thanks for the code! Just one issue, after clicking register the page reloads and the email field stays, entering the same data in for the 2nd time then only registers

    Reply
    1. Rodolfo Melogli
      March 6, 2022

      Try to exclude that page from server- and WP-side cache

      Reply
  26. Damian
    January 19, 2022

    A checkbox for accepting the regulations in both places could be useful. My account and for a separate registration page.

    Reply
    1. Rodolfo Melogli
      February 14, 2022

      Yep, good idea

      Reply
  27. WishfulThinking
    December 20, 2021

    These snippets are working in a PHP 8 environment but styling is crude and I don’t know how to fix that.

    I noticed that the fields on the registration form are the same as on the combined page so …?

    I need the complete details because of the nature of my business for EULA of digital downloads.

    Thank you and best wishes.

    Reply
    1. Rodolfo Melogli
      January 8, 2022

      Screenshot please?

      Reply
  28. Emmanuel
    November 7, 2021

    This line

     woocommerce_login_form( array( 'redirect' => 'https://custom.url' ) );

    redirects every user role including admin to my-account page. How do i exclude admin from the redirect so admins will follow the standard redirect to dashboard?

    Reply
    1. Rodolfo Melogli
      November 8, 2021

      Hey Emmanuel thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
      1. Ryan
        January 4, 2022

        It’s pretty easy:

        if ( current_user_can('administration') ) {
          woocommerce_login_form( array( 'redirect' => 'https://custom.url/wp-admin/' ) );
        } else {
          woocommerce_login_form( array( 'redirect' => 'https://custom.url' ) );
        }
        

        Hope that helps!

        Reply
        1. Rodolfo Melogli
          January 8, 2022

          Cool

          Reply
          1. Daniela
            February 7, 2022

            Hello!, where do I have to paste this code?, I get an error in the functions.php

            woocommerce_login_form( array( ‘redirect’ => ‘https://custom.url’ ) );

            Thanks!

            Reply
            1. Rodolfo Melogli
              March 5, 2022

              Hi Daniela, that line pf PHP belongs to snippet #2. Did you paste the whole snippet #2 in functions.php? That line alone will give you an error indeed

              Reply
  29. Sohom Das
    October 31, 2021

    WoW Rodolfo,

    Your codes works awesome for me, I have a little customisation in my mind please let me know if it is possible.

    What I am lookin for a “button” on Login page as “Register” or “Not Register Yet” something like that below the login button, so that I can redirect Customers to Registration page from login page.

    Please reply if it is possible.
    Thanks in advance.

    Reply
    1. Rodolfo Melogli
      November 8, 2021

      Hey Sohom thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  30. Matthew
    October 18, 2021

    How can I get reCaptcha for WooCommerce to work with this registration form. Currently, it works on all other Woo forms including login, but it only displays the “Recaptcha” title on the registration form.

    Reply
    1. Rodolfo Melogli
      October 27, 2021

      Hi Matthew thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  31. Gabor Lippert
    October 13, 2021

    Thanks, guys, but this doesn’t work anymore in 2021.

    Or maybe because I use WordFence with WooCommerce and Google ReCaptcha V3 integration – but the registration shortcode doesn’t work.

    Symptoms: after submitting the custom registration form, nothing happens. No login, no error message, just a page refresh, and nothing else. ¯\_(ツ)_/¯

    Reply
    1. Rodolfo Melogli
      October 27, 2021

      If you disable those plugins, does it work?

      Reply
      1. Sohom Das
        October 31, 2021

        It worked for me I am using wordfence too. But no idea if it’s not working for recaptcha or not.

        Reply
  32. Joeri
    October 11, 2021

    Hi,

    I am using the Separate WooCommerce Login (Shortcode) snippet but the first time somebody is trying to login, the page just refreshes. The second time the login form works fine and you can login successfully. Any idea on what might cause this? Maybe a cache issue but it happens every time so I think that’s weird.

    Reply
    1. Rodolfo Melogli
      October 12, 2021

      If you temporarily disable server-side cache and cache plugins, does it work?

      Reply
  33. NK
    September 6, 2021

    Thanks for this.

    I was having problems styling the form as it didn’t pick up the theme or woocommerce styles.

    Enclosing the form within div class woocommerce helped

    Reply
    1. Rodolfo Melogli
      September 15, 2021

      Nice

      Reply
  34. Akash
    May 15, 2021

    Hello

    I was trying to use the code, but why in this code email address and password not align to each other..

    Please guide how to atleast align them properly.

    Reply
    1. Rodolfo Melogli
      June 2, 2021

      Hi Akash, this is default WooCommerce. If they align properly in the My Account page and they don’t here, it means you have a custom theme or custom CSS that is changing the default behavior, so you need to add some custom CSS as well

      Reply
  35. Omar Lopez
    March 23, 2021

    Hi, In a Separate WooCommerce Customer Registration page if the user is already loged in the form isn´t show anymore, is there a way that if the user is already login show another content instead of the register form??

    Reply
    1. Rodolfo Melogli
      April 19, 2021

      Hi Omar, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  36. Marco
    March 20, 2021

    Hello, is it compatibile with the plugin “Custom User Registration Fields for WooCommerce”?

    Reply
    1. Marco
      March 20, 2021

      And how can I add a “don’t have a account?” link on the login page?
      Thank you.

      Reply
      1. Rodolfo Melogli
        March 22, 2021

        Hi Marco, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

        Reply
    2. Rodolfo Melogli
      March 22, 2021

      No idea 😀

      Reply
  37. Tim
    February 26, 2021

    Thank you for the nice code!
    I am using Astra theme and everything works for me except that the width of fields and line breaks are not working as usual.

    Please check this image to see how it normally should look like:
    https://i.postimg.cc/wjPH7KYw/normal-form.jpg

    And this is how the forms look with shortcodes:
    https://i.postimg.cc/KYMbT9Zx/problem-form.jpg

    Would be very thankful if you could advice whats causing these issues and how to solve them.

    Best regards,
    Tim

    Reply
    1. Rodolfo Melogli
      March 24, 2021

      Hi Tim, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  38. Roland
    February 5, 2021

    Hi i treid to copy the snippet in the php area from oxygen, but it doesnt react…..am i doing something wrong?

    Reply
    1. Rodolfo Melogli
      February 18, 2021

      Not sure about Oxygen sorry

      Reply
      1. Daren
        February 19, 2021

        Use code snippets. I just did it on an oxygen site and it’s working fine.

        Reply
      2. Jeffrey
        March 10, 2021

        Hi,

        Temporary remove or comment the following code:

        if ( is_admin() ) return;
        if ( is_user_logged_in() ) return;

        If you try to open with Oxygen it is telling it’s logged in, so it will return nothing.

        Reply
  39. Ralf Longwitz
    December 18, 2020

    Hi Rodolfo,
    Do you know of a simple way to make the password visible while typing? I.e. the usual switch button, mostly an eye icon.
    Had a client today claiming login doesn’t work … just mistyped password. Happens to myself often.
    Thanks!

    Reply
    1. Rodolfo Melogli
      December 21, 2020

      Hi Ralf, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  40. iammammdal
    October 8, 2020

    thank you Rodolfo
    how can I add a checkbox for accepting the terms and make it required? Actually I have the code and it works properly, but I don’t know where to place it in this snippet.
    I also need a link to Registration Page on Login Page. I used the snippet #1 only

    Reply
    1. Rodolfo Melogli
      October 16, 2020

      Hi, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  41. Oscar
    August 31, 2020

    Hi all,

    Hope you are fine, I’ve a little issue, I’m using this snippet but the notice is not showing on the good place.

    For exemple if the password is not correct, the notice is shown on Registration page not on the login page. It is possible to solve this issue?

    Reply
    1. Rodolfo Melogli
      September 10, 2020

      Hi Oscar, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
      1. Ethan
        September 21, 2020

        Hi how do you set up the register to redirect to login page?

        Reply
        1. Rodolfo Melogli
          September 21, 2020

          Hi Ethan, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

          Reply
  42. Jatinder Kaur
    July 28, 2020

    Thanks a lot !!!!

    Reply
    1. Rodolfo Melogli
      July 28, 2020

      You’re welcome!

      Reply
  43. Shyam
    July 3, 2020

    I would like to remove the strong password criteria for user registration and setup the password condition like: any characters(letters/digits) with minimum of 6 and maximum of 16 character. Can you provide the sample code for this.

    Reply
    1. Rodolfo Melogli
      July 7, 2020

      Can’t, sorry

      Reply
  44. Seynal Kim
    June 30, 2020

    For some reason, the registration form won’t submit when using Dokan plugin, something’s missing, I think its Javascript or JQuery. I tried, using the shortcode

    woocommerce_my_account

    , and everything works but it cannot be used to create a separate login/registration page because it will show the account dashboard when the user is currently logged in.

    Anyway, when clicking the submit button on the registration form, the console gives me the following error.

    An invalid form control with name='fname' is not focusable.
    An invalid form control with name='lname' is not focusable.
    An invalid form control with name='shopname' is not focusable.
    An invalid form control with name='shopurl' is not focusable.
    An invalid form control with name='phone' is not focusable.
    

    The registration form works if the Dokan Plugin is not active, but I need it for a multi-vendor. Asking the issue to the Dokan support is a waste of time, 62 hours until now no response from them.

    Can you help me with this?

    Reply
    1. Rodolfo Melogli
      July 7, 2020

      Hi Seynal, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
      1. Seynal Kim
        July 15, 2020

        Nevermind, there’s a missing hook.

        remove_action( 'woocommerce_register_form', 'dokan_seller_reg_form_fields' );

        When using the Dokan plugin, the registration form will be altered or override by Dokan to add the custom field for Vendor Registration. The separate registration form won’t simply work because it is being blocked by the error and it is being handled by Dokan. By using the hook above, it removes the Dokan Custom Field for Vendor Registration.

        Reply
        1. Rodolfo Melogli
          July 20, 2020

          Nice

          Reply
  45. Mateus
    June 23, 2020

    Date: 06-22-2020
    Wc Version: 4.2.1

    Worked, Tks!!

    Reply
    1. Rodolfo Melogli
      June 28, 2020

      Awesome

      Reply
  46. alien
    May 21, 2020

    can you make it a plugin?

    Reply
    1. Rodolfo Melogli
      May 26, 2020

      No, sorry

      Reply
  47. Dhrovo
    April 26, 2020

    Hello, Rodolfo Melogli, thank you for this great post. i was suffering a lot to solve this issue and today i got it.

    Reply
    1. Rodolfo Melogli
      April 29, 2020

      Cool!

      Reply
  48. Amy Roseman
    April 25, 2020

    Hi! Thanks for help splitting these pages!

    The pages work, but the text and text boxes are out of alignment. I’m using a woocommerce compatible theme (Astra), so there shouldn’t be a conflict.

    How would you recommend I fix that?

    Thanks!

    Reply
    1. Rodolfo Melogli
      April 29, 2020

      Hello Amy, thanks so much for your comment! Yes, this is definitely possible with custom CSS, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  49. Carl Hales Davies
    April 17, 2020

    This worked fine for me

    What I found though and it looks like a few people in the comments had the same issue.

    It looks like a BLANK screen when you do it CORRECTLY

    But this is because you are already LOGGED in

    If you log out. You can see the form perfectly.

    Is there a way we can get it to re-direct to a certain URL?

    Or at least say thanks for registering or something?

    Thanks

    Reply
    1. Rodolfo Melogli
      April 20, 2020

      Hi Carl! If you referring to Snippet #2, I’ve added a “redirect” argument you could test in order to redirect logged in users to a custom URL. Let me know if that works!

      Reply
      1. John Boase
        May 1, 2020

        Great info and works a treat…thank you!

        What would I need to change the argument ‘woocommerce_login_form( array( ‘redirect’ => ‘https://custom.url’ ) );’ to in order for me to use it within #Snippet 1 on the registration page please and would you mind telling me if it should go directly under ‘ob_start();’ or directly above ‘return ob_get_clean();’.

        Keep up the great work!

        Regards

        John

        Reply
        1. Rodolfo Melogli
          May 13, 2020

          Sorry, can’t help

          Reply
      2. Miguel
        May 3, 2020

        Hi, I have the same problem in the case of Snippet #1.

        I put the snippet on a new “Regist” page, when user puts his email and press the button, the page is reloaded without the form.

        It is possible to redirect the user to another url?

        Thank you.

        Reply
        1. Miguel
          May 3, 2020

          I made this little change:

          this:

          if ( is_user_logged_in() ) return;

          for:

          if ( is_user_logged_in() ){ header( "Location: /mi-cuenta" ); die; }
          Reply
          1. Rodolfo Melogli
            May 13, 2020

            Ok

            Reply
            1. Dave
              September 30, 2020

              Miguel’s solution worked well. I have only amended it to redirect to the my-account page, so it looks as follows:

              if (is_user_logged_in() ){ header( “Location: /my-account” ); die; }

              Reply
              1. Rodolfo Melogli
                October 1, 2020

                Cool

                Reply
  50. Robert
    April 11, 2020

    Hello, thanks for this review! Sadly, it doesn’t work for me.
    I pasted the codes in my function.php and used this shortcode on my page: [wc_reg_form_bbloomer]. I also unchecked ‘allow customers to…’
    I’m using a Divi Child theme.

    Am I doing something wrong? Would be very happy if this works! I want a custom registration page and a custom login page.
    Would someone be so kind to help me?

    Stay save!

    Best regards,
    Robert
    (The Netherlands)

    Reply
    1. Rodolfo Melogli
      April 14, 2020

      Hi Rob, thanks for your comment! I just tested this again with Storefront theme and it works perfectly. Maybe your theme (or another plugin) is messing/conflicting with my snippet?

      To troubleshoot, disable all plugins but WooCommerce and also switch temporarily to “Twentyseventeen” theme (load the snippet there in functions.php) – does it work? If yes, you have a problem with your current theme or one of the plugins.

      Hope this helps!

      R

      Reply
  51. Ahmed Elsayed
    April 10, 2020

    Hi Rodolfo,

    I did everything you said, but unfortunately it doesn’t show any thing on the register page.

    would you help me fix this?

    Thanks in advance.

    Reply
    1. Rodolfo Melogli
      April 14, 2020

      Ahmed, thanks so much for your comment! I’m afraid it’s custom work – if you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  52. Mark
    April 3, 2020

    I put this code in my child theme via FTP. When I put the shortcode on the login page, it only shows [wc_login_form_bbloomer] on the page (same for the registration page). I don’t know what I am doing wrong and I look forward to your reply.

    Reply
    1. Rodolfo Melogli
      April 9, 2020

      That means those shortcodes are not registered. Used the exact same code? Maybe you have errors in your functions.php?

      Reply
  53. Giorgiokatr
    March 28, 2020

    I would like to keep the default two tab login register . Can i use snipppet 1 to add this register shortcode to a different page? I would like on that different page to show the registration form only. But keep also the existing functionallity of WooCommerce in tbe default my account.

    Reply
    1. Rodolfo Melogli
      March 31, 2020

      Of course!

      Reply
  54. Amir Khan
    March 6, 2020

    how can use forgot password short code

    Reply
    1. Rodolfo Melogli
      March 9, 2020

      Hi Amir, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  55. Greg Salyer
    January 24, 2020

    This worked but does not put a box around the login and the user name and password fields are not the same length. How can I make it look like the one on [[woocommerce_my_account]]

    Reply
    1. Rodolfo Melogli
      January 25, 2020

      Hi Greg, you probably need to re-use some CSS classes or add your custom CSS. Either way this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  56. Aidan
    January 2, 2020

    This is fantastic work and is helping to solve a lot of the problems I have on the project I’m working on thanks a lot!

    There is one small problem though and I was hoping you could help with that since you seem pretty in the loop here. I’ve added a bunch of extra custom fields to registration for the site I’m on and added them, but now when I display them they come out first before Email. I only realized that was an entirely different issue half way through typing this, but hey, maybe you know how I can reorder my registration fields without a plugin? Seems to me, if you’re creating your own separate pages, then there is a fair chance you might have done this yourself, so heres hoping.

    Best,
    Aidan

    Reply
    1. Rodolfo Melogli
      January 6, 2020

      Hi Aidan, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  57. dev
    November 29, 2019

    There is no success message showing after successfull registration

    Reply
    1. Rodolfo Melogli
      December 2, 2019

      See previous comments & let me know

      Reply
  58. Tiago Oliveira
    November 25, 2019

    I posted the code on my theme’s function file and have a seperate register page nos, everything works fine, the only problem i have is that the register form design does not match my theme, how can i make it match the theme?

    Reply
    1. Rodolfo Melogli
      November 27, 2019

      You’ll need some CSS magic. Sorry but that’s custom to your theme/website

      Reply
  59. Peter
    November 15, 2019

    I’m wondering it would be safer and simpler if if I would hide login or registration form with js. I could add a button “Not yet a user? Register here.” and reveal reg form with js. Similarly a button after reg form (“I registered already. Login here.”) and reveal login form and hide reg form. This way the vanilla forms can stay. Thoughts?

    Reply
    1. Rodolfo Melogli
      November 19, 2019

      Sure, anything is possible!

      Reply
    2. Simmi Dhaliwal
      December 4, 2019

      Hi Peter! I love this idea and it’s exactly what I’m looking for. Is there any way you can share how you did this?

      Reply
      1. Sohom Das
        October 31, 2021

        I am looking for this solution, have you get the solution?

        Reply
  60. Shobhit Gupta
    November 5, 2019

    Hi,
    I tried it with my website and it is working perfectly. Thanks for sharing this info with us.

    Reply
    1. Rodolfo Melogli
      November 10, 2019

      Great!

      Reply
  61. Allan
    November 4, 2019

    where should i add the registration short-code

    Reply
    1. Rodolfo Melogli
      November 10, 2019

      Anywhere you like. Custom WP page maybe?

      Reply
  62. kaushik
    October 13, 2019

    Not work on my websites

    Reply
    1. Rodolfo Melogli
      October 22, 2019

      Works on mine, sorry 😐

      Reply
  63. James
    October 12, 2019

    The fields not adding in the registration form using a plugin. I am trying to add it manually. Is there any alternative to do this? It would be really helpful if you could help me to add fields in the registration form.

    Reply
    1. Rodolfo Melogli
      October 22, 2019

      James, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  64. Tomas
    September 18, 2019

    Hi, thanks for this!

    I used both snippets. after successfully registering, I then login via custom page with the [wc_login_form_bbloomer] short code.

    Right after it logs in successfully login the page which turns blank and not redirect me to /my-account/. Later manually going to /my-account/ does work though.

    TL;DR It’s not redirecting to /my-account/ after successful login-any ideas?

    Reply
    1. Rodolfo Melogli
      September 19, 2019

      Hi Tomas, you can pass a ‘redirect’ argument inside woocommerce_login_form() function, that should do the trick

      Reply
      1. doniphan
        January 16, 2020

        Could you show me where this would go in the snippet?

        Reply
        1. Rodolfo Melogli
          January 20, 2020

          No, sorry. But look at this, maybe it can help: https://docs.woocommerce.com/wc-apidocs/source-function-woocommerce_login_form.html#2090-2106

          Reply
  65. Julian
    September 17, 2019

    Hi, is the a way to add additional fields like Name and Last Name to the Snippet?

    Reply
    1. Rodolfo Melogli
      September 19, 2019

      https://businessbloomer.com/woocommerce-add-first-last-name-account-register-form/

      Reply
  66. Max Terbeck
    September 2, 2019

    Thanks for this code Rodolfo!
    I was having the problem that error messages were not displaying, I found that if you insert

    <?php do_action( 'woocommerce_before_customer_login_form' ); ?>

    before the form method solves the problem.

    Reply
    1. Rodolfo Melogli
      September 6, 2019

      Excellent!

      Reply
      1. Hamad
        December 9, 2022

        Where do you add this exactly on the separate login snippet? I can’t seem to figure where to add it .

        I am trying to get the error messages on my login for when they enter wrong info like password or email etc.

        Reply
        1. Rodolfo Melogli
          December 16, 2022

          Hi Hamad, check the latest version of the snippet and le tme know

          Reply
  67. mid
    August 30, 2019

    Question – I copy pasted both snippets into my child theme’s functions.php file, but the form doesn’t appear. The shortcode doesn’t appear either, it’s just a blank. Could you help me pls?

    Reply
    1. mid
      September 1, 2019

      Ok, so it’s working now 🙂 But the registration page button doesn’t work. Clicking it doesn’t do anything, it remains static

      Reply
      1. Rodolfo Melogli
        September 6, 2019

        It should work 🙂

        Reply
    2. Al
      October 2, 2019

      How did you get it working? It’s a blank content area for me, the shortcode also does not appear!?

      Reply
    3. Mochammad
      November 16, 2019

      Hey, I am stuck with this now, could you help me? I am curious how you can solve it. Thank you!

      Reply
  68. Jay Thornton
    August 6, 2019

    2 issues I’ve gotten.
    1. I’ve got TOS Agree enabled and it’s not part of your register form.
    2. No errors showing so users don’t know something is incorrect.

    Reply
    1. Rodolfo Melogli
      August 12, 2019

      Hi Jay!

      1. I’ve got TOS Agree enabled and it’s not part of your register form.

      Enabled in the Woo settings? Do they show on the standard My Account page?

      2. No errors showing so users don’t know something is incorrect.

      I just tested this again with Storefront theme on my homepage and errors show perfectly. Maybe your theme (or another plugin) is messing/conflicting with my snippet?

      To troubleshoot, disable all plugins but WooCommerce and also switch temporarily to “Twentyseventeen” theme (load the snippet there in functions.php) – does it work? If yes, you have a problem with your current theme or one of the plugins. Hope this helps!

      Reply
  69. Chris
    July 26, 2019

    Hi,

    It doesn’t validate emails. So, if someone tries and email that is already in use it just stays the same and doesn’t give an error.

    Thanks,

    Reply
    1. chris
      July 26, 2019

      Is the above snippet 1 correct (see below)? Should #registra be something else “registration”?

      form method=”post” class=”woocommerce-form woocommerce-form-register register” action=”#registra”

      Reply
      1. Rodolfo Melogli
        August 1, 2019

        Try now, I’ve revised the 2 snippets 🙂

        Reply
  70. Shmulik
    July 26, 2019

    Another solution: create two pages with the shortcode [woocommerce_my_account]
    use css to hide login form on one page and hide the registration form on the second page.
    This way you can have the validation on the page.

    Shmulik

    Reply
    1. Rodolfo Melogli
      August 1, 2019

      Good idea as well, however hiding things with CSS is not great in regard to performance. And someone techy can always set that to display:block

      Reply
  71. Ofer
    July 16, 2019

    This is great!
    I have to say that your solutions are the best out there. I believe I owe you money LOL.
    I have only one suggestion for this snippet: wrap the with so any styling done with this class will apply too.

    Reply
    1. Rodolfo Melogli
      July 22, 2019

      Thank you Ofer!

      Reply
  72. marvin
    July 16, 2019

    The code is still working, only 1 problem I found, and i was wondering if you cooed help with this.
    Error code are not displayed. so you get no feedback, if you use the wrong password it tells you nothing (making users think its broken, when there password and or username is wrong)

    Ps: Sry dyslexic.

    Reply
    1. Demian
      July 23, 2019

      Woocommerce has this php snippet for the error messages, which is missing in the above snippet: . You put this before the .

      However, if you separate the login form and the register form, you can put these notices only once in your snippet, so I am not sure how to add this if you have 2 shortcodes for both forms, you cannot add it for both forms. Some tips or advice would be good.

      Reply
  73. دانلود رمان
    July 3, 2019

    i tried this but its not working i have errors of all kind here

    Reply
    1. Rodolfo Melogli
      July 8, 2019

      Screenshot please?

      Reply
  74. Yakub
    June 24, 2019

    thank you for this code. This code is very useful.
    How can i redirect it to a custom page after login/registration using this code.

    Reply
    1. Rodolfo Melogli
      July 6, 2019

      Hi Yakub, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  75. Enrico
    June 18, 2019

    Hi Rodolfo,
    I followed your guide to create a registration page separate from the login. Everything works except field validation!
    Even if I leave the fields empty, the form does not return an error.
    How can I solve it? Thank you

    Reply
    1. Rodolfo Melogli
      June 20, 2019

      Good point Enrico – if you already did the default troubleshooting (disable all plugins but WooCommerce and also switch temporarily to “Twentyseventeen” theme), then there’s for sure a missing part in the snippet or we need to call the validation in some other way. If you find a solution let me know 🙂

      Reply
    2. Deborah
      June 20, 2019

      I have the same problem too. When I followed this guide and set up the custom registration form, the validation worked perfectly. I realized only yesterday that the validation fields had stopped working and I can’t find a solution to fix the problem. I think it depends on woocommerce updating, but I don’t know for sure.

      Does anyone have a suggestion on what to do?

      Reply
  76. Vanessa
    June 2, 2019

    I’m sorry but your “login” seperate page snippet #2 does not work. At all. The form doesn’t show up.

    Reply
    1. Rodolfo Melogli
      June 6, 2019

      Works for me 🙂 To troubleshoot, disable all plugins but WooCommerce and also switch temporarily to “Twentyseventeen” theme (load the snippet there in functions.php) – does it work?

      Reply
  77. Roee
    April 30, 2019

    Hey there. I’ve just copied Snippet #1 to my child theme’s functions.php but something in the code brakes the site. I’ve tried to change line 23 to my child theme path I thought it might help but it didn’t.

    Any advice please?

    Reply
    1. Rodolfo Melogli
      May 8, 2019

      You’re right, thank you! Snippet 1 fixed 🙂

      Reply
  78. Drew
    April 26, 2019

    I’ve added a few snippets to my Child Theme’s functions.php file without any problems. And if there is a possible problem…the php editor I use will not allow the code to be registered.

    Well…copied the first snippet that creates the shortcode for the registration page and once I hit the ‘save’ button…my site was immediately broke!

    So, guess it’s time to remove the code and move onto a different solution.

    But seriously…why we even have to look for a workaround for something WooCommerce should provide the option for (separate login and registration pages) is kind of ridiculous!

    Drew
    Las Vegas, NV

    Reply
    1. Rodolfo Melogli
      May 8, 2019

      Hello Drew, what error did you get when your site got “broken”?

      Reply
      1. Rodolfo Melogli
        May 8, 2019

        Hold on, I found the bug. Snippet 1 fixed!

        Reply
  79. John
    April 21, 2019

    Hey Rodolfo, great work thank you. But I have a question, notifications are not showing up “wrong password, required fields, etc.” how can we implement those notifications on new registration page?

    Reply
    1. Rodolfo Melogli
      May 8, 2019

      Good question John! Try with https://stackoverflow.com/questions/46631939/display-woocommerce-notices-on-a-page

      Reply
  80. thomas
    April 11, 2019

    “woocommerce password strength” don’t work in “Separate WooCommerce Customer Registration” page.
    There is a solution to this problem?

    https://stackoverflow.com/questions/51674995/woocommerce-custom-registration-form-no-password-validation

    Thank’s

    Reply
    1. Rodolfo Melogli
      April 19, 2019

      Hello Thomas, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  81. kapadiyah
    March 18, 2019

    It’s not working, could you please help

    Reply
    1. Rodolfo Melogli
      March 28, 2019

      Hey Kapadiyah, what error are you getting?

      Reply
  82. Maged Mohamed
    March 11, 2019

    When i try to add the snippet both the first and the 2nd i got an error: https://prnt.sc/mw9qrf

    i tried to add it using functions.php and also tested with code snippet plugin but i got the same error .. why and what is that line ?

    Reply
    1. Rodolfo Melogli
      March 15, 2019

      I can see the error there… on line 23

      Reply
  83. Umair Arshad
    February 26, 2019

    code is very useful,
    thank you so much, but i need some more fields in registration form.
    i want first name, last name and retype password fields as well.
    kindly response me if you can.
    thanks again.

    Reply
    1. Rodolfo Melogli
      February 27, 2019

      Umair, thanks so much for your comment! Yes, this is possible – unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding! ~R

      Reply
  84. romeo
    February 15, 2019

    Yes it is still working. Thank you=. But the problem I have is I want it to redirect to the home page after login in and also the login page shouldn’t show after users are logged in

    Reply
    1. Rodolfo Melogli
      February 27, 2019

      Thank you 🙂 Maybe try using the [[woocommerce_my_account]] shortcode instead of the login one. The other issue, that’s custom work sorry!

      Reply
    2. Marvin
      July 16, 2019

      Hi i also wanted people to be redirected to the home page after login / logout
      Here is the code i’m using:

      ———————————————————————————————————————————

      /*—————————————————————————-*/
      // redirects for login / logout
      /*—————————————————————————-*/
      add_filter(‘woocommerce_login_redirect’, ‘login_redirect’);

      function login_redirect($redirect_to) {

      return home_url();

      }

      add_action(‘wp_logout’,’logout_redirect’);

      function logout_redirect(){

      wp_redirect( home_url() );

      exit;

      }

      ——————-End-of-code-Do-Not-coppy-this-line——————–

      I hope this works for you 🙂

      Reply
      1. Rodolfo Melogli
        July 22, 2019

        Hi Marvin, thanks for your comment 🙂

        Yes I’m sure errors can be shown, but this is custom work and I can’t help via the blog comments I’m afraid.

        That code you shared is awesome, thanks for that!

        Reply
  85. Peter
    February 15, 2019

    Rodolfo, Thank you for writing this up for us! I will try it when I have time and check back on you. Keep up the great work.

    Reply
    1. Rodolfo Melogli
      February 27, 2019

      Nice 🙂

      Reply
  86. Nghĩa
    February 13, 2019

    thank

    Reply
    1. Rodolfo Melogli
      February 14, 2019

      You’re welcome!

      Reply
      1. tahir khan
        November 13, 2019

        error message not showing in registration shortcode like email address already exists.

        Reply
        1. Rodolfo Melogli
          November 14, 2019

          https://businessbloomer.com/woocommerce-separate-login-registration/#comment-264665

          Reply
Questions? Feedback? Customization? Leave your comment now!
_____

If you are writing code, please wrap it like so: [php]code_here[/php]. Failure to complying with this, as well as going off topic or not using the English language will result in comment disapproval. You should expect a reply in about 2 weeks - this is a popular blog but I need to get paid work done first. Please consider joining the Business Bloomer Club to get quick WooCommerce support. Thank you!

Cancel reply

Your email address will not be published. Required fields are marked *


Search WooCommerce Tips

Popular Searches: Visual Hook Guides - Checkout Page - Cart Page - Single Product Page - Add to Cart - Emails - Shipping - Prices - Hosting

Recent Articles

  • WooCommerce: Redirect Empty Paginated Category Pages (404)
  • WooCommerce: Complete Button @ Order Admin
  • WooCommerce: Allow Guest Checkout For Existing Customers
  • WooCommerce: Simplify Free Checkout
  • WooCommerce: Inject Ad After the nth Product @ Shop Page

Latest Comments

  1. Rodolfo Melogli on WooCommerce: Separate Login, Registration, My Account Pages
  2. Rodolfo Melogli on WooCommerce: Complete Button @ Order Admin
  3. Rodolfo Melogli on WooCommerce: Failed Orders Monitor & Temporary Lockdown

Find Out More

  • Become a WooCommerce Expert
  • Business Bloomer Club
  • WooCommerce Blog
  • WooCommerce Weekly
  • Contact

Contact Info

Ciao! I'm Rodolfo Melogli, an Italian Civil Engineer who has turned into an international WooCommerce expert. You can contact me here:

Twitter: @rmelogli

Get in touch: Contact Page

Business Bloomer © 2011-2025 - VAT IT02722220817 - Terms of Use - Privacy Policy

Cart reminder?

x