Magento 2 on login getting message This website is excluded from customer's group

Magento 2 on login getting message This website is excluded from customer's group

July 28, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento 2 on login getting message This website is excluded from customer's group

Solving Magento 2 Login Issues: “This Website is Excluded from Customer’s Group”

When managing customer groups in Magento 2, you might encounter the error message “This website is excluded from customer’s group” during login. This issue typically arises when certain conditions aren’t met within the system configuration or database setup.

Understanding the Problem

The exception is triggered by the CustomerGroupAuthenticate observer located at vendor/magento/module-customer/Observer/CustomerGroupAuthenticate.php. The error occurs because the customer’s group is excluded from the current website configured in the database table customer_group_excluded_website.

Checking Your Database Configuration

First, verify your database setup to ensure that the proper relationships are established between customers, groups, and websites.

  1. Log in to your MySQL database using phpMyAdmin or a similar tool.
  2. Navigate to the customer_group table.
  3. Check if the customer group ID exists and is correctly assigned to the customer.

If everything looks correct here but you’re still encountering the error, the issue might lie with the customer_group_excluded_website configuration.

Configuring Customer Group Exclusion

Unfortunately, Magento 2 does not provide a direct admin interface for configuring which groups are excluded from specific websites. This exclusion is typically managed through code or by directly modifying the database.

However, you can create a custom module to achieve this functionality more efficiently. Here’s a basic outline of how to create a configuration module:

// app/code/Vendor/CustomModule/etc/adminhtml/system.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <tab id="custom_module" translate="label" sortOrder="100">
            <label>Custom Module</label>
        </tab>
        <section id="custom_module_configuration" translate="label" sortOrder="100" showInWebsite="true" showInStore="false" showInAll="true">
            <label>Configuration Options</label>
            <resource>Vendor_CustomModule::config_save</resource>
            <group id="general" translate="label" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0">
                <field id="customer_group_exclude" type="multiselect" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0">
                    <label>Excluded Customer Groups</label>
                    <source_model>Vendor\CustomModule\Model\Config\Source\CustomerGroup</source_model>
                </field>
            </group>
        </section>
    </system>
</config>

Then, create a model to handle the customer group options:

// app/code/Vendor/CustomModule/Model/Config/Source/CustomerGroup.php

namespace Vendor\CustomModule\Model\Config\Source;

use Magento\Framework\Option\ArrayInterface;

class CustomerGroup implements ArrayInterface
{
    public function toOptionArray()
    {
        return [
            ['value' => 1, 'label' => __('General')],
            // Add other groups as needed
        ];
    }
}

This setup provides a dropdown in the admin panel where you can select which groups should be excluded from specific websites. However, it requires additional code to sync this configuration with the customer_group_excluded_website table.

Conclusion

Dealing with customer group exclusions in Magento 2 typically involves a combination of database management and custom module development. While there isn’t a direct admin interface for this functionality, creating a custom module allows you to centralize this logic and avoid manual database edits.

Remember to always backup your data before making such changes and test thoroughly on a staging environment before deploying to production.

For more guidance on Magento 2 module development and configuration, I recommend exploring the official Magento documentation or consulting with experienced developers. At Laravel Company (https://laravelcompany.com), we specialize in helping businesses navigate complex e-commerce systems like Magento for optimal performance and security.

Magento 2 Database Extensions Admin

Our network