How to swap firstname and lastname in customer grid magento 2

1 Answer 1


You have to override the vendor/magento/module-customer/view/adminhtml/ui_component/customer_listing.xml file.

Check the below Link. It may be useful

How Override the grid customer magento 2

  • Thanks for your answer got idea from that
    – kanidhaya
    Jun 4, 2021 at 18:24
  • please help me same for frontend how to swap firstname and last name in checkout and my account billing and shpiing address form?
    – kanidhaya
    Jun 4, 2021 at 18:29
  • @kanidhaya inchoo.net/magento-2/frontend/… you can do it database level also, select * from eav_attribute where entity_type_id = 2 and (attribute_code='firstname' or attribute_code='lastname'); run above query and get attribute ids of firstname and lastname. after that run below query with respective attribute id and update sort_order column value. select * from customer_eav_attribute where attribute_id = <attribute id>; I highly recommend to use first option.
    – Singhe
    Jun 5, 2021 at 16:13

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.