So I have installed a fresh install of Magento 2.0.4, on my old magento site, I have disabled the customer accounts through various methods and the cart works fine. customers are directed to paypal express checkout. I have now spent the better part of all morning with customers disabled through the advanced section of the configuration for the site.


This for some reason totally breaks the shopping cart. I cant remove items. Items don't show up in the basket, but are really there after i add another item, again not being able to remove it.

So I now have the customer enabled in the backend advanced section, but i dont want ANY customer data locally and only have that stored in paypal. This is for my safety, and theirs (the customer) as I, just like many other magento store owners have well been versed on all kinds of hacks.

Is there some sane way to disable the customer/account/sign in without breaking the shopping cart?

3 Answers 3


This is how i did it. I am using the luma theme your theme might differ, but should be similar. I found the right blocks to delete by enabled in the admin store -> configuration -> advanced -> developer -> debug -> enable hints and add block names to hints

I edited the /var/www/magento2/vendor/magento/theme-frontend-luma/Magento_Customer/layout/default.xml

and changed

<move element="register-link" destination="header.links"/>


<move element="register-link" destination="delete"/>

and added the following

<referenceBlock name="customer" remove="true" />
<referenceBlock name="authorization-link-login" remove="true" />

this takes care of it on the main page

I have added this to my /etc/http/conf.d/ssl.conf to drop all external connections to the signup for customers page

<LocationMatch "/customer/account/">
Order Deny,Allow
Deny from All
Allow from

I also have removed the newsletter, review, rss, sendfriend, and wishlist because I think they link back to the customer account pages

It would be really swell if the developers could disconnect the customer module from the shopping basket module, so I could just disable the customer side if I wanted any other above features, but I don't, so I don't care. I try to remove any boxes for someone to drop code in, regardless of whether there is a known attack vector or not. Call me paranoid I have no need at the moment for customer accounts or any of the things I disabled and my shopping basket ships off straight to a paypal checkout so there is no input on my end (I really don't want to be responsible for customer credentials and cc #s at this point).


Check this: Weird behavior after login

I think you're experiencing the same behavior, look at the answers maybe one of them can help you.

EDIT: Also, check this: https://stackoverflow.com/questions/3617832/disable-customer-in-magento I think is the answer.

  • That is a really old q&a and I am currently using magneto 2.0.4, so while sort of helpful not really. I actually did successfully remove the sign in/register from the header, it should just be much easier, and its not. After I get my head wrapped around an solid how to answer I will answer my own question, yet again
    – Chris
    Commented May 6, 2016 at 12:31
  • Well, yeah it's old, but the answer is still applicable. I've been working with the login functions and what I saw is Magento never uses the field is_active inside customer_entity table, so it can be used inside a plugin of execute() function defined in Magento\Customer\Controller\Account\LoginPost. I'm using Magento 2.0.2 .
    – hiperboreo
    Commented May 9, 2016 at 2:41

Editing the templates files and redirecting through server is a nice hack.

Here is an interesting module, just tested, it is fully working : https://github.com/deved-it/magento2-disable-customer-registration

It disable only the 'Create an account' function, and redirect on accessing direct link : /customer/account/create/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.