I am making users programmatically (weird system that a company wants, where users send their details to company's email, they then create user in their CRM, and upload users data to server, where I pick it up and create user from it), and the problem is, that password shorter than 6 characters are not allowed. I've updated this in administration, and that seems to only work when users register in the frontend.

How can I set minimum password length for users I am making in the backend?

Example of code that creates user:

    $CustomerModel = $objectManager->create('Magento\Customer\Model\Customer');


    if (!$CustomerModel->getId()) {
        $customer = $customerFactory->create();


1 Answer 1


Go to :



You can change password length from here.

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.