🔥 Just Launched! Werra Premium Template for HyväSee it in Action

How to Remove Field in Billing Address From Checkout in Magento 2

By Sanjay JethvaUpdated on May 21, 2025 2 min read

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.

According to Baymard, 21% of US online shoppers have abandoned an order in the past quarter solely due to a “too long/complicated checkout process”.

A complex checkout process can break a sale and prompt customers to bounce to your competitor.

In order to avoid such things in Magento 2 store, remove the extra fields that are unnecessary for your business.

For example, if you are offering a downloadable product type, you can afford to remove the city field. Downloadable products need not get delivered to a physical address.

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.

The programmatic solution to remove field in billing address from checkout in Magento 2 is given below using layoutprocesser.

Solution to Remove Field in Billing Address From Checkout in Magento 2:

1. Create di.xml file at app/code/vendor/Exenstion/etc/frontend

<? xml version = "1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">

    <type name="Magento\Checkout\Block\Checkout\LayoutProcessor">
        <plugin name="remove_checkout_billing_address_fields"
                type="vendor\Exenstion\Plugin\Checkout\BillingAddressLayoutProcessor" sortOrder="1"/>
    </type>

</config>

2. Create BillingAddressLayoutProcessor.php file at app/code/vendor/Exenstion/Plugin/Checkout

<?php

namespace vendor\Exenstion\Plugin\Checkout;

use Magento\Checkout\Block\Checkout\LayoutProcessor;


class BillingAddressLayoutProcessor
{
    public function afterProcess(
        LayoutProcessor $subject,
        array $result
    )
    {
        $this->result = $result;


        $billingConfiguration = &$this->result['components']['checkout']['children']['steps']['children']['billing-step']
        ['children']['payment']['children']['payments-list']['children'];

        if (isset($billingConfiguration)) {
            foreach ($billingConfiguration as $key => &$billingForm) {
                if (!strpos($key, '-form')) {
                    continue;
                }
                if ($billingForm['children']['form-fields']['children']['remove_field']) {
                    unset($billingForm['children']['form-fields']['children']['city']);
                }

            }
        }
        return $this->result;
    }

}

In the above code, make changes in ‘remove_field’ to remove the desired field based on your requirement.

That’s it.

Do consider sharing this post with Magento Community via social media.

Thank you.

Sanjay Jethva Full Image
Article bySanjay Jethva

Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe. His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.