{"id":1554,"date":"2021-01-23T19:30:38","date_gmt":"2021-01-23T19:30:38","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/show-address-fields-in-registration-form-in-magento-2\/"},"modified":"2025-07-17T10:05:53","modified_gmt":"2025-07-17T04:35:53","slug":"show-address-fields-in-registration-form-in-magento-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/show-address-fields-in-registration-form-in-magento-2\/","title":{"rendered":"How to Show Address Fields in Registration Form in Magento 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Online store owners tend to collect maximum customer information which can be used for marketing purposes and improve the customer experience.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Registration form is best for collecting maximum data which can be used further for business requirements.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The default\u00a0Magento 2\u00a0registration form allows admin to collect customer data such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Name and last name<\/li>\n\n\n\n<li><a href=\"https:\/\/meetanshi.com\/blog\/add-date-of-birth-in-registration-form-in-magento-2\/\" target=\"_blank\" rel=\"noreferrer noopener\">date of birth<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/meetanshi.com\/blog\/enable-middle-name-in-registration-form-in-magento-2\/\" target=\"_blank\" rel=\"noreferrer noopener\">middle name&nbsp;<\/a><\/li>\n\n\n\n<li>Email<\/li>\n\n\n\n<li>Telephone<\/li>\n\n\n\n<li>Fax<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Note, In Magento 2, the Show or we can say&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/enable-middle-name-in-registration-form-in-magento-2\/\">Enable Middle Name in Registration Form<\/a>&nbsp;is an optional field, also you can&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/add-date-of-birth-in-registration-form-in-magento-2\/\">add date of birth in registration form<\/a>&nbsp;as an customer attribute.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, it may not be enough for every business with various requirements.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One important detail about the customer is their address. A store owner can&nbsp;<em><strong>show address fields in registration form in Magento 2<\/strong><\/em>&nbsp;to collect the location details and use it in designing the marketing strategy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In addition to collecting address details, it is crucial for store owners to&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/show-tax-vat-number-in-registration-form-in-magento-2\/\">show Tax\/VAT Number in Registration Form in Magento 2<\/a>&nbsp;as it helps in complying with tax regulations and building trust with customers by displaying transparency in pricing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For instance, if your store is selling apparels, it\u2019s a waste of time to send notification of winter clothes(Jackets, scarf, gloves) to the customers living in a hot climate!<em><\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also, the address detail is essential if your business is delivering physical products.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use the below solution to display address fields in the Magento 2 sign up form.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The registration form in the default Magento 2 looks something&nbsp; like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2021\/01\/Before-code-1.png\" alt=\"Before code\" class=\"wp-image-12761\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now, we\u2019ll see how to add the address fields in this form.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Method to Show Address Fields in Registration Form in Magento 2<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Add below code in your&nbsp;<strong>customer_account_create.xml&nbsp;<\/strong>file<\/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&lt;page xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\n      xsi:noNamespaceSchemaLocation=\"urn:magento:framework:View\/Layout\/etc\/page_configuration.xsd\">\n    &lt;body>\n        &lt;referenceBlock name=\"customer_form_register\">\n            &lt;arguments>\n                &lt;argument name=\"show_address_fields\" xsi:type=\"boolean\">true&lt;\/argument>\n            &lt;\/arguments>\n        &lt;\/referenceBlock>\n    &lt;\/body>\n&lt;\/page><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After applying the solution, the custom sign up form displays the address field as shown here:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2021\/01\/After-code-1-791x1024.png\" alt=\"after adding address\" class=\"wp-image-12764\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it! Also to prevent yourself from multiple form submission and storing same data of same user, once clicked on submit button&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/disable-submit-button-on-form-submission-in-magento-2\/\">Magento 2 disable submit button on form submission<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can also&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/add-or-remove-address-field-from-pdf-in-magento-2\/\" target=\"_blank\" rel=\"noreferrer noopener\">add or remove address field from PDF in Magento 2<\/a>&nbsp;as per your requirements.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Please 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\n\n\n<p class=\"wp-block-paragraph\"><strong>Also Read:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/meetanshi.com\/blog\/magento-2-registration-form-not-showing-state-dropdown\/\" target=\"_blank\" rel=\"noreferrer noopener\">Fix: Magento 2 Registration Form Not Showing State Dropdown<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Online store owners tend to collect maximum customer information which can be used for marketing purposes and improve the customer experience. Registration form is best&#8230;<\/p>\n","protected":false},"author":13,"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-1554","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1554","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\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=1554"}],"version-history":[{"count":3,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1554\/revisions"}],"predecessor-version":[{"id":14536,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1554\/revisions\/14536"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=1554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=1554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=1554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}