{"id":1419,"date":"2020-11-26T11:44:16","date_gmt":"2020-11-26T11:44:16","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/remove-field-in-billing-address-from-checkout-in-magento-2\/"},"modified":"2025-05-21T17:41:31","modified_gmt":"2025-05-21T12:11:31","slug":"remove-field-in-billing-address-from-checkout-in-magento-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/remove-field-in-billing-address-from-checkout-in-magento-2\/","title":{"rendered":"How to Remove Field in Billing Address From Checkout in Magento 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">As an online store owner, it is your responsibility to optimize the checkout step and make it easy for the customer to complete their order.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">According to&nbsp;<a href=\"https:\/\/baymard.com\/lists\/cart-abandonment-rate\" target=\"_blank\" rel=\"noreferrer noopener\">Baymard<\/a>,&nbsp;21% of US online shoppers have abandoned an order in the past quarter solely due to a&nbsp;<em>\u201ctoo long\/complicated checkout process\u201d<\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A complex checkout process can break a sale and prompt customers to bounce to your competitor.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In order to avoid such things in Magento 2 store, remove the extra fields that are unnecessary for your business.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, if you are offering a&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/create-downloadable-products-in-magento-2\/\" target=\"_blank\" rel=\"noreferrer noopener\">downloadable product type<\/a>, you can afford to remove the city field. Downloadable products need not get delivered to a physical address.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Depending on the business requirements, you may skip collecting customer details on the checkout that are not necessary for marketing purpose or for order completion.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The programmatic solution to&nbsp;<em><strong>remove field in billing address from checkout in Magento 2<\/strong><\/em>&nbsp;is given below using layoutprocesser.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Solution to Remove Field in Billing Address From Checkout in Magento 2:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">1. Create&nbsp;<strong>di.xml&nbsp;<\/strong>file at<strong><em>&nbsp;app\/code\/vendor\/Exenstion\/etc\/frontend<\/em><\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;? xml version = \"1.0\"?>\n\n&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\n        xsi:noNamespaceSchemaLocation=\"urn:magento:framework:ObjectManager\/etc\/config.xsd\">\n\n    &lt;type name=\"Magento\\Checkout\\Block\\Checkout\\LayoutProcessor\">\n        &lt;plugin name=\"remove_checkout_billing_address_fields\"\n                type=\"vendor\\Exenstion\\Plugin\\Checkout\\BillingAddressLayoutProcessor\" sortOrder=\"1\"\/>\n    &lt;\/type>\n\n&lt;\/config><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">2. Create&nbsp;<strong><em>BillingAddressLayoutProcessor.php&nbsp;<\/em><\/strong>file at&nbsp;<strong><strong><em>app\/code\/vendor\/Exenstion\/Plugin\/Checkout<\/em><\/strong><\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\n\nnamespace vendor\\Exenstion\\Plugin\\Checkout;\n\nuse Magento\\Checkout\\Block\\Checkout\\LayoutProcessor;\n\n\nclass BillingAddressLayoutProcessor\n{\n    public function afterProcess(\n        LayoutProcessor $subject,\n        array $result\n    )\n    {\n        $this->result = $result;\n\n\n        $billingConfiguration = &amp;$this->result['components']['checkout']['children']['steps']['children']['billing-step']\n        ['children']['payment']['children']['payments-list']['children'];\n\n        if (isset($billingConfiguration)) {\n            foreach ($billingConfiguration as $key => &amp;$billingForm) {\n                if (!strpos($key, '-form')) {\n                    continue;\n                }\n                if ($billingForm['children']['form-fields']['children']['remove_field']) {\n                    unset($billingForm['children']['form-fields']['children']['city']);\n                }\n\n            }\n        }\n        return $this->result;\n    }\n\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In the above code, make changes in&nbsp;<strong>\u2018remove_field\u2019<\/strong>&nbsp;to remove the desired field based on your requirement.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do consider sharing this post with Magento Community via social media.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As an online store owner, it is your responsibility to optimize the checkout step and make it easy for the customer to complete their order&#8230;.<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-1419","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1419","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=1419"}],"version-history":[{"count":3,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1419\/revisions"}],"predecessor-version":[{"id":13923,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1419\/revisions\/13923"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=1419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=1419"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=1419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}