in magento2 , How to remove last name ,Only first name is retained.

I see magento1.x have such a plugins.


You can 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

Go to below file where you can find class field-name-lastname in code. delete complete this div for last name.


You can copy the file to your custom theme or module and change accordingly. Not recommended to change directly in core module.

  • 2.1.2 , I did not find this directory vendor/magento/module-customer Oct 25 '16 at 14:38
  • I just downloaded and able to see Magento-CE-2.1.2_sample_data-2016-10-11-11-27-51\vendor\magento\module-customer\view Oct 25 '16 at 14:40
  • hello, I download new version magento 2.12, I looked module-customer/view/nam.phtml/ . I want to ask you , The checkout page, how to remove last name field . Oct 26 '16 at 13:34
  • hello,how to remove The billing address shipping address last name ? Nov 3 '16 at 1:11
  • Hi krishna, i need to remove it, only in checkout page May 15 '18 at 12:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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