If you’re running a Magento 2 store, you’ve probably noticed a sudden influx of suspicious customer registrations, often from .ru domains or temporary disposable email addresses.
By default, Magento 2 allows any email address to create a customer account. While this makes registration easy for legitimate users, it also opens the door for spammers and bots who flood your database with fake accounts. These spam registrations not only waste server resources but can also affect your store’s performance and data accuracy.
So, how do you stop spam email registrations in Magento 2?
Stop Spam Emails in Magento 2 with MageArmy Restrict Fake Registration Extension
The MageArmy Restrict Fake Registration extension gives store owners full control over who can register on their Magento 2 store.
It lets you allow or deny specific email domains so you can easily block spam emails from domains like @mail.ru, @tempmail.com, or any disposable email provider.

With this extension, you can:
- Allow only trusted email domains (e.g.,
@gmail.com,@company.com) - Deny spammy or unwanted domains
- Customize the error message users see when they try to register with a restricted email
- Enable or disable the restriction anytime from the Magento admin panel
This is the easiest and most efficient way to stop fake account creation without affecting your genuine customers.
How to Install MageArmy Restrict Fake Registration in Magento 2
Follow these simple steps to install and configure the MageArmy Restrict Fake Registration extension:
Step 1: Purchase the Extension
Visit the official page – MageArmy Restrict Fake Registration – and purchase the extension.
Step 2: Upload the Code
Copy the downloaded extension code to the following directory in your Magento 2 installation:
app/code/Magearmy/RestrictFakeRegistration
Step 3: Enable the Module
Run the following command:
bin/magento module:enable Magearmy_RestrictFakeRegistration
Step 4: Deploy the Extension
Run the standard Magento setup and deployment commands:
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
Step 5: Configure the Extension
Go to your Magento Admin Panel:
Stores > Configuration > MageArmy > Restrict Fake Registration
You’ll find a configuration group named Restrict By Email, which controls how the email domain restriction works.
Configuration Options
Enable Restrict By Email: Activate this option to start restricting customer registration based on email domains.
Email Domains Restriction Mode: Choose one of the two available modes:
Allow Mode: Only allow customers with domains listed in the “Allow Email Domains” field.
Deny Mode: Block registrations from domains listed in the “Deny Email Domains” field.
Allow Email Domains

List all email domains that should be allowed to register (comma-separated). For example:
gmail.com, yahoo.com, outlook.com, company.com
Allow Email Domain Error Message
Customize the error message users will see if they try to register with an email domain not in the allowed list.
Deny Email Domains

List all domains that should be blocked from registration. For example:
mail.ru, tempmail.com, 10minutemail.net
Deny Email Domain Error Message
Set a custom message that will appear when a user attempts to register using a denied domain.
Once configured, save the settings, clear the Magento cache, and test the registration form to ensure your restrictions are working properly.
Why Use MageArmy Restrict Fake Registration?
- Stops spam and fake registrations instantly
- Simple configuration from the Magento admin panel
- Keeps your customer database clean and reliable
- Saves server resources by preventing junk entries
- Custom error messages improve the user experience
- Lightweight, compatible, and easy to maintain