We've recently had some issue with spammers using the registration page to send spam emails. We've enabled the magento captcha but are still seeing the spam emails being sent.

I've seen others online prevent the spam emails by decreasing the length limit for the customer firstname and lastname fields which prevent the spammers from including a link. The method I've seen to do this online is to update the customer_eav_attribute table changing the validate_rules column for attribute_ids 5 and 7. This however does not seem to be working for me.

The value I have for these attributes are:


But I am still able to create accounts with names longer than 25 characters.

Is there something else I need to do to cause the validation to happen? Or is there a different way to limit the character length for these fields?

Any help would be greatly appreciated as spam emails are still being sent from our store.

2 Answers 2

  1. Confirm on eav_attribute table that,
Id 5 = firstname
Id 7 = lastname
  1. After that please run these commands one's.

php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento indexer:reindex
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
sudo chmod -R 777 var/ generated/ pub/


Try changing directly in the database. Reduce the size of the table in the database

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.