Magento – Magento 2 – Remove last name from registration form

customermagento2register

How to remove the last name field in registration form?

Best Answer

You have to copy file from

projectroot\vendor\magento\module-customer\view\frontend\templates\widget\name.phtml

And paste to in you theme.

You can find class field-name-lastname in code. delete complete this div for last name.

You have to run below query in your database for set lastname as optional for customer.

UPDATE eav_attribute SET is_required = 0 WHERE attribute_code = 'lastname' and `entity_type_id` = 1

Run Command : php bin/magento cache:clean

Let me know if you have any issue.

Related Topic