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.
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.
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!
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”
I may be missing something but your line
appears to put the login form into another form and thus becomes invalid.
Presumably it did work?
I guess so. Have you tested it?
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.
Hi there, that doesn’t sound like default WooCommerce, so you must check with the custom plugin developers
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!
Thank you Lee Ann. That must be your theme, as WooCommerce doesn’t do that out of the box. Ask your theme devs please 🙂
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.
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!
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.
Hey Johnny, it could be your theme. Try switching to another one for a sec and test again
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!
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!
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?
Yes, makes sense. Some jQuery might be needed as well to achieve what you need
I have been trying to make a button of “Click here to login” instead of a plain linked-text.
How can I do it?
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
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!
Hey Janneke, thanks for your comment! Try under “Accounts and Privacy”, it’s my screenshot that is out of date 🙂
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.
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
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.
Hey Chuckers, you can enable “Guest” checkout from the settings and avoid the account creation process 🙂
I am trying to move the Create an Account to the top of my checkout page. Could someone please help me.
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
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 🙂
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
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?
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
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).
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!
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.
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 🙂
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.
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
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. 🙂
Understood 🙂 To redirect from My Account to Checkout is super easy (check this tutorial by WooThemes). Hope this helps!
I found this on the stackexchange.
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?
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.
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? 🙂
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’ );
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
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?
Thank you Alex 🙂 You could simply use to hide the whole form. Let me know!