Extension available here https://github.com/ajourquin/module-disable-customer

This extension for Magento 2 allows you to disable a customer from admin.
Once a customer is disabled he cannot log in on storefront anymore.

A message is displayed that the account is disabled when trying to log in.

You can view the current status of an account under “Personal Information
section in “Customer view” in admin panel.


Installation

Using composer

  • composer require ajourquin/module-disable-customer
  • bin/magento setup:upgrade

Using archive

  • Backup your database
  • Unzip the archive
  • Place the content of the archive under MAGENTO_ROOT/app/code/
  • Then run bin/magento setup:upgrade

Disable / Enable a customer account

  • Connect to the Magento admin
  • Go to Customers > All customers
  • Select the customer to disable/enable
  • Click on “Account Informations” tab, then switch on/off “Account disabled” field to your needs.

Uninstall

If installed with composer

  • Run bin/magento module:uninstall -r Ajourquin_DisableCustomer

If installed with archive

  • Delete the folder MAGENTO_ROOT/app/code/Ajourquin/DisableCustomer
  • Drop column ‘is_disabled’ in ‘customer_entity’ table
  • Run bin/magento setup:upgrade