WooCommerce: Remove or Move User Login / Registration at Checkout

Whether you want to disable login / registration on the WooCommerce Checkout page or move the login form from the top to the bottom of it, this is a simple thing to do. You can do it via a PHP snippet or WooCommerce settings.

Solution 1: Remove Login/Registration @ Checkout Page

Just untick/uncheck the fields in red.

WooCommerce settings: remove login/registration at checkout page

Solution 2 (PHP Snippet): Move Login/Registration Below the Billing Section @ WooCommerce Checkout

/**
 * @snippet       Move Login @ WooCommerce Checkout
 * @how-to        Get CustomizeWoo.com FREE
 * @author        Rodolfo Melogli
 * @compatible    WC 3.5.4
 * @donate $9     https://businessbloomer.com/bloomer-armada/
 */

remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_login_form', 10 );
add_action( 'woocommerce_after_checkout_billing_form', 'woocommerce_checkout_login_form' );

Where to add this snippet?

You can place PHP snippets at the bottom of your child theme functions.php file (delete "?>" if you have it there). CSS, on the other hand, goes in your child theme style.css file. Make sure you know what you are doing when editing such files - if you need more guidance, please take a look at my free video tutorial "Where to Place WooCommerce Customization?"

Does this snippet (still) work?

Please let me know in the comments if everything worked as expected. I would be happy to revise the snippet if you report otherwise (please provide screenshots). I have tested this code with Storefront theme, the WooCommerce version listed above and a WordPress-friendly hosting on PHP 7.3.

If you think this code saved you time & money, feel free to join 14,000+ WooCommerce Weekly subscribers for blog post updates or 250+ Business Bloomer supporters for 365 days of WooCommerce benefits. Thank you in advance :)

Need Help with WooCommerce?

Check out these free video tutorials. You can learn how to customize WooCommerce without unnecessary plugins, how to properly configure the WooCommerce plugin settings and even how to master WooCommerce troubleshooting in case of a bug!

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.

43 thoughts on “WooCommerce: Remove or Move User Login / Registration at Checkout

  1. I may be missing something but your line

    add_action( 'woocommerce_after_checkout_billing_form', 'woocommerce_checkout_login_form', 12 );

    appears to put the login form into another form and thus becomes invalid.

    Presumably it did work?

    1. I guess so. Have you tested it?

  2. Hi thanks for this, I’m just wondering will this allow customers to add a product to the cart without having to log in and allow them to make an account or log in to their account during the checkout,

    Im currently having issues with my site where a non logged in customer cannot add a product to their cart and a popup appears stating “Sorry, you must be logged in to participate in lottery” I would like to change this so the product can be added to their cart and they are then prompted to make an account/login during the checkout process

    I’ve seen this done on other sites but haven’t figured out how to do this myself

    thank again for the article, and any help is super appreciated.

    1. Hi there, that doesn’t sound like default WooCommerce, so you must check with the custom plugin developers

  3. Thanks for the GREAT info! WooCommerce customization is something I’m learning as a matter of necessity to improve my user experience.

    Maybe you can help with one related question?
    I’m trying to remove the “Register” link from the header where it says Sign in or Register since I have a separate registration funnel that I’d like visitors to follow. Is there a CSS code I can insert to remove this but still allow signups?

    Thanks so much for this awesome resource!

    1. Thank you Lee Ann. That must be your theme, as WooCommerce doesn’t do that out of the box. Ask your theme devs please ๐Ÿ™‚

      1. I had to get help with this exact same issue yesterday while using a plugin to optimize user checkout experience and the dev was super helpful with providing CSS to hide these alerts that show automatically as part of my theme. Plugin is WooCommerce MultiStep Checkout Wizard by Kole_Roy.

        The following code in my case did the trick in hiding the unwanted alerts as the plugin had streamlined the checkout process so that those with accounts could log in first.

        woocommerce-checkout .woocommerce-form-login-toggle{
         display:none !important
        }

        Please note this is CSS code, and you should put this where you’re placing any custom CSS (even more specifically on the checkout page if you can).

        Thank you Rodolfo for making this awesome code available. It definitely does the trick if it’s exactly what you’re looking for!

        1. Nice!

  4. All of a sudden I have login and register forms appearing above the normal checkout information on the checkout page. This only started appearing after I migrated to a new hosting provider last week. I tried the code provided on this page to move these forms to the bottom of the checkout page, but the code did nothing. I’ve used code snippets from this site a few times before, all have worked and have been amazing (thank you Rodolfo!).

    The text “Returning customer? Click here to login” is also visible, on the left side above where the customer would input their details, below the forms.

    If I UNCHECK “allow customers to log in to an existing account during checkout”, it removes the text “Returning customer? Click here to login” but it DOES NOT remove the login form that is appearing at the top of the checkout page.

    If I UNCHECK “allow customers to create an account during checkout”, it removes the “create account” checkbox and password field within the checkout form area, but it DOES NOT remove the register form that is appearing at the top of the checkout page.

    The register form is removed from the checkout page only if I UNCHECK the “allow customers to create an account on the “My account” page”, which makes no sense since this should affect the my account page and not the checkout page. I cannot leave this unchecked, because then only a Login Form appears at the top of the checkout page and it makes it appear as though you cannot create an account.

    These forms are pushing the checkout fields below the fold and makes is=t confusing for customers, especially since there is a login form, then text below it that says “Returning customer? Click here to login”, and a registration form, but then a checkbox and password field to easily register as part of the check process.

    I cannot find any place where these forms are controlled, and I don’t have any plugins specific to the checkout process or logging in, nor do I have any code snippets active which might affect this. As I mentioned, this only happened after I migrated to a new hosting provider.

    I want this to go back to the way it was before, which was simply the text link to login to an existing account, and an in-line checkbox within the checkout form to create an account at the same time as checking out. I want these forms removed but can’t find where to do this and I have no idea how they got there in the first place!

    Upon inspection, both forms are within a “div.account-container.lightbox-inner”, I’m not sure if that means anything. If anyone can help it would be greatly appreciated. Many thanks.

    1. Hey Johnny, it could be your theme. Try switching to another one for a sec and test again

  5. I think I have all the settings right (although the options are not the same as in the screenshot), but still I get some complaints from people who say they made an account and can’t login the second time they want to order. I don’t want people to make accounts, but aparantly it can’t be stopped!
    https://www.tvwilskracht.nl/winkel/deelname-winterturntoernooi/

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

  6. Thanks for this hook! But out of some reason the login form is always visible now and the click on “already have an account? Click here” does not work. Do you know why this is happen?

    1. Yes, makes sense. Some jQuery might be needed as well to achieve what you need

  7. Hi Rodolfo!

    I have been trying to make a button of “Click here to login” instead of a plain linked-text.

    How can I do it?

    Thank You.

    1. Hello Younes, 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. Thanks a lot for your understanding! ~R

  8. Hi! I want to turn off the registration option, but I don’t see all the options that you show in this article. I don’t have the tab ‘accounts’ in my woocommerce settings page.

    How is that possible? I got the latest woocommerce version!

    Hope you can help me! Thnx!

    Janneke

    1. Hey Janneke, thanks for your comment! Try under “Accounts and Privacy”, it’s my screenshot that is out of date ๐Ÿ™‚

  9. Hi Rodolfo,

    Firstly thanks for your nice blog to support woo-commerce user and developer. I need a solution for woocommerce store. I want people can only register after they purchase product. Now they can register at checkout page but before they pay registration is completed. Without payment the can access dashboard. I want to restrict it. Would you please help me to do this. Actually I want who purchase product can only get dashboard access.
    Thanks in advance.

    Regards
    Abdullah

    1. Hello Abdullah, thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. Thanks a lot for your understanding! ~R

  10. This doesn’t really work properly. All it does is take the customer to a page that tells them they have to login to purchase from the store, but it doesn’t allow them to create an account nor does it even give a link to an account creation page.

    So, essentially, this is worse since it is confusing to customer as it is unhelpful and illogical. Customers will leave and/or it will create excessive customer service emails

    My guess is that Woocommerce wants you to pay them for a proper “account creation before checkout” process, which I am not about to do.

    1. Hey Chuckers, you can enable “Guest” checkout from the settings and avoid the account creation process ๐Ÿ™‚

  11. I am trying to move the Create an Account to the top of my checkout page. Could someone please help me.

    1. Karen, thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. Thanks a lot for your understanding! ~R

  12. Hello Dear,

    Thank you for the instructions they are so helpful, but I want to ask if there is a way to add login link when it comes to “You must be logged in to checkout.”

    Thank you again ๐Ÿ™‚

    1. Hello Tamara, thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here on the blog. Thanks a lot for your understanding! ~R

  13. Hello,

    I was wondering if it’s possible to move the actual registration form on the checkout page above the form, just like the login form? I tried to move it myself, but it’s not working. It appears fine, but if you insert a username and password, and place a (test) order, it’s not working. The account isn’t created. Any tips?

    Thanks!

    1. Hey Alex, thanks for your message. Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here on the blog. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding! ~R

  14. Hi!

    Here is my problem:

    I have a membership site (using wooommerce Sensei). On the checkout page the client gives his information and can make the payment via Paypal or wire transfer. My problem is that the account for the client is already created even if he or she does not finalize the payment. Basically one can choose wire transfer, never make the payment, but account is created and he/she already has access to the member area and the content.

    My goal would be: Unless the payment is done (returning from Paypal after succesful payment or I have manually marked the order succesful on the system if wire transfer is used), then no account is generated for the person. WHEN it is done, however, account should be created automatically and sent to the e-mail of the client (which is entered during the ordering process).

    Any recommendations?

    Thank you!

    Mikk

    1. Mikk, thanks for your comment and very interesting challenge you have! Unfortunately the “wire transfer” option is messing up the whole flow there, and as you said accounts get created even if payment is not done.

      What about disabling account registration on the checkout, and do this on the “payment received” page or “completed order” email instead?

      Or otherwise, why not assigning a “paid” membership to users, that gets assigned only when payment is made? Then, only “paid” members will be able to access Sensei courses.

      Let me know!

  15. Dear Rodolfo

    I am not a techie, and volunteering for a non-profit website. So, kindly bear with this question ๐Ÿ™‚

    We want to achieve the following:
    1. Force the user to login first, before they can checkout
    2. How can I use your suggestion of “” in the reverse? Will this be enough to check condition 1 above or some more work is required?

    Using WP 4.5.1 and Woo 2.5.5

    Thank you in advance.

    1. Hey Vy, thanks for your comment ๐Ÿ™‚ All you need is disabling Guest Checkout (WooCommerce > Settings > Checkout > Enable guest checkout (untick). Other than that, I’m not sure what you mean at point 2) so maybe let me know! Thanks ๐Ÿ™‚

      1. Thanks for your inputs. ๐Ÿ™‚

        I was wondering if using the opposite of your suggestion in this thread
        //
        would help us achieve the feature of showing the checkout page only to logged in users. If not logged in, then I want to show /my-account/ page.

        Best wishes.

        1. Yes Vy, all you need is disabling Guest Checkout (WooCommerce > Settings > Checkout > Enable guest checkout (untick)). After that, checkout will not be accessible unless you’re logged in/registered

          1. Thanks Rodolfo, I used this feature on the Admin page, but it works differently to our requirement. For example, the checkout page is shown, along with the “registration fields” included in the same page.

            Instead, we want that the user should log-in/register “before” the checkout page is shown. Something like cart–>login/register–>checkout ๐Ÿ™‚

            Sorry, but this is for a specific reason. ๐Ÿ™‚

            Thanks.

            1. Understood ๐Ÿ™‚ To redirect from My Account to Checkout is super easy (check this tutorial by WooThemes). Hope this helps!

      2. Dear Rodolfo

        I found this on the stackexchange.

        //Woocommerce visible only to logged-in users
        function wpse_131562_redirect() {
            if (
                ! is_user_logged_in()
                && (is_checkout())
            ) {
                // feel free to customize the following line to suit your needs
                wp_redirect(site_url('my-account/'));
                exit;
            }
        }
        add_action('template_redirect', 'wpse_131562_redirect');

        The above code is allowing for checking if user is logged in (for checkout page only) and if not, then redirects to “my-account” page.

        This is the closest I could find. And tested it by pasting it in my child-theme functions.php page.

        I am trying to learn how to make this code more useful – the user should login –> thereafter be redirected to the checkout page, no?

        Very grateful for any thoughts/help in this regard?

  16. Hello
    I run a woocoommerce site where I want people to register. Everything about the account is working. However I want to hide the “login” from my menu when a customer is logged in. I ahve added css class for the login-page (nav-login) and the same for the my account page (nav-account). Could you tell me the code to hide the login page and it’s subcategories such as log-out, edit adress when a customer is logged in and where I should add the code.
    Thanks

    1. Erik thank you for your comment! You could do something similar to this: https://businessbloomer.com/wordpress-add-css-specific-page-url-via-php. You can then edit that snippet by using the conditional tag is_user_logged_in and echoing CSS if the IF statement returns true. Does this help? ๐Ÿ™‚

  17. Dear Rodolfo,

    Can you tell please where I should put this code to switch off login form from checkout page ?

    // move login at checkout from above form to above billing
    remove_action( ‘woocommerce_before_checkout_form’, ‘woocommerce_checkout_login_form’, 10 );
    add_action( ‘woocommerce_before_checkout_billing_form’, ‘woocommerce_checkout_login_form’ );

    1. Olegs, thanks for your message! I’m going to record a video about this, as many of you had the same issue. I will let you know when this is available! R

  18. Yep, great method for touching the login form in the checkout page, thank you Rodolfo,

    Do you have any idee how to remove the login form frm the my account page when the visitor is not logged in?

    1. Thank you Alex ๐Ÿ™‚ You could simply use to hide the whole form. Let me know!

Questions? Feedback? Support? Leave your Comment Now!
_____

If you are writing code, please wrap it between shortcodes: [php]code_here[/php]. Failure to complying with this (as well as going off topic, not writing in English, etc.) will result in comment deletion. 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 BloomerArmada to get blog comment reply priority, ask me 1-to-1 WooCommerce questions and enjoy many more perks. Thank you :)

Your email address will not be published.