PHPackages                             wubinworks/module-disable-customer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. wubinworks/module-disable-customer

ActiveMagento2-module

wubinworks/module-disable-customer
==================================

Disable Customer Extension for Magento 2. Disable/Enable customer login, password reset and account activation. Works for both Frontend and WebAPI area.

1.0.0(1y ago)35.0k↓88.9%OSL-3.0PHPPHP &gt;=7.4

Since Oct 17Pushed 1y ago2 watchersCompare

[ Source](https://github.com/wubinworks/magento2-disable-customer)[ Packagist](https://packagist.org/packages/wubinworks/module-disable-customer)[ RSS](/packages/wubinworks-module-disable-customer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Disable Customer Extension for Magento 2
========================================

[](#disable-customer-extension-for-magento-2)

[![Wubinworks Disable Customer](https://raw.githubusercontent.com/wubinworks/home/master/images/Wubinworks/DisableCustomer/disable-customer.jpg "Wubinworks Disable Customer")](https://www.wubinworks.com/disable-customer.html)

Introduction
------------

[](#introduction)

In various business situations, the store owners may want to disallow certain customers to login but they do not want to delete those accounts so they can re-enable them in the future.

Surprisingly, Magento 2 doesn't offer such a feature.

There are some ways that store owners tend to adopt but cannot truly "Disable" an account. The customer could always have workarounds.

- Delete customer -&gt; Register by using the same email again
- Deactivate account -&gt; Re-activate account via receiving confirmation email again
- Lock account -&gt; Unlock by resetting password

Features
--------

[](#features)

- Disable/Enable customer:
    - Login
    - Password reset
    - Account activation(sending confirmation email)
- Above works for both Frontend and WebAPI area
- Disabled customer is forced to logout instantly and all WebAPI tokens are revoked
- "Login As Customer" support: Yes. Admin can "Login As Customer" from backend even if the customer is disabled
- Can set custom error message on a per-customer basis
- Can set default error message as fallback
- Admin customer grid filter option for filtering disabled/enabled customer

\*Note: the custom error message is displayed only if the customer provided correct credentials(i.e., Email and Password).

Requirements &amp; Compatibility
--------------------------------

[](#requirements--compatibility)

Only tested on **Magento 2.4 CE**
This extension does not use `preference` and `template override`.

Installation
------------

[](#installation)

**`composer require wubinworks/module-disable-customer`**

Configuration
-------------

[](#configuration)

Admin Panel `Stores > Configuration > Wubinworks > Disable Customer`

- `Default Disabled Customer Message`
    If you leave the `Disabled Customer Message` empty on customer editing page, this fallback message will be used.

By default, customer is not disabled.

To force a customer to logout immediately, use the `Disable -> Save -> Enable -> Save` trick.

For Developers
--------------

[](#for-developers)

##### Customer Attributes:

[](#customer-attributes)

- By default, all customer attributes added by this extension are "backend only attributes", which means they are invisible and unchangeable via `\Magento\Customer\Api\CustomerRepositoryInterface` in `Customer User Context`.
- If you want to override "backend only attributes", create a small module and check `etc/di.xml` for instructions.
- If you want to change "backend only attributes" value in `Customer User Context`(e.g., in your frontend controller), use `\Magento\Customer\Model\Customer` instead. You can also check `\Wubinworks\DisableCustomer\Helper\Customer::updateCustomerAttribute` for an example.

##### Events:

[](#events)

- name: `wubinworks_disabled_customer_try_login`
    data: 'customer' =&gt; `\Magento\Customer\Api\Data\CustomerInterface`
    when: Disabled customer attempts to login with correct credentials
- name: `wubinworks_customer_disabled`
    data: 'customer' =&gt; `\Magento\Customer\Model\Customer`
    when: After successfully setting customer to disabled
- name: `wubinworks_customer_enabled`
    data: 'customer' =&gt; `\Magento\Customer\Model\Customer`
    when: After successfully setting customer to enabled

♥
-

[](#)

If you like this extension please star this repository.

You may also like: [Disable Change Email for Magento 2](https://github.com/wubinworks/disable-change-email)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

572d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7de965a6287fb784969afeb4b173521d3cb59c6b873b7248263abb9fc098eddd?d=identicon)[wubinworks](/maintainers/wubinworks)

---

Top Contributors

[![wubinworks](https://avatars.githubusercontent.com/u/127310257?v=4)](https://github.com/wubinworks "wubinworks (2 commits)")

---

Tags

accountcustomerdisable-customerloginmagento2magento2-customermagento2-extensionmagento2-extension-freemagento2-webapiopen-dependencymagento 2 extensionemail confirmationwebapipassword-resetrevoke tokendisable customerdisable loginforce logout

### Embed Badge

![Health badge](/badges/wubinworks-module-disable-customer/health.svg)

```
[![Health](https://phpackages.com/badges/wubinworks-module-disable-customer/health.svg)](https://phpackages.com/packages/wubinworks-module-disable-customer)
```

###  Alternatives

[hprose/hprose

It is a modern, lightweight, cross-language, cross-platform, object-oriented, high performance, remote dynamic communication middleware. It is not only easy to use, but powerful. You just need a little time to learn, then you can use it to easily construct cross language cross platform distributed application system.

2.1k215.3k37](/packages/hprose-hprose)[olegkoval/magento2-regenerate-url-rewrites

Add into Magento 2 a CLI feature which allow to regenerate a Url Rewrites of products and categories

4423.7M2](/packages/olegkoval-magento2-regenerate-url-rewrites)[ellaisys/aws-cognito

AWS Cognito package that allows Auth and other related features using the AWS SDK for PHP

120220.7k1](/packages/ellaisys-aws-cognito)[koraktor/steam-condenser

The Steam Condenser is a library for querying the Steam Community, Source and GoldSrc game servers

21045.6k](/packages/koraktor-steam-condenser)[rakuten-ws/rws-php-sdk

The SDK of Rakuten Web Service

90116.2k](/packages/rakuten-ws-rws-php-sdk)[magepsycho/magento2-custom-shipping

Magento 2 Custom Shipping

697.5k](/packages/magepsycho-magento2-custom-shipping)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
