{"id":41400,"date":"2016-02-19T14:56:52","date_gmt":"2016-02-19T14:56:52","guid":{"rendered":"http:\/\/webkul.com\/blog\/?p=41400"},"modified":"2025-01-28T15:02:33","modified_gmt":"2025-01-28T15:02:33","slug":"how-to-create-customer-custom-attribute-in-magento-2-0","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/","title":{"rendered":"How to Create Customer Custom Attribute in Magento 2"},"content":{"rendered":"\n<p>Here we will learn, How to create a Customer <a href=\"https:\/\/store.webkul.com\/magento2-multi-vendor-custom-attributes.html\" target=\"_blank\" rel=\"noreferrer noopener\">Custom Magento 2 attribute<\/a>.<\/p>\n\n\n\n<p><strong>Note:<\/strong> We also have a separate module (<strong><a href=\"https:\/\/store.webkul.com\/Magento-2\/Magento2-Custom-Registration-Field.html\">Magento 2 Custom Registration Fields<\/a><\/strong>) that allows the admin to create custom customer fields.<\/p>\n\n\n\n<p>Henceforth, using the Custom Magento 2 attribute module you can extend your customer sign-up form. For more information, you can check it on <a href=\"https:\/\/store.webkul.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Webkul&nbsp;Store<\/a>.<\/p>\n\n\n\n<p>Let&#8217;s start the process.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"http:\/\/i.imgur.com\/2HtLZV7.png\" alt=\"Image\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>We can achieve this by using the following methods:<\/p>\n\n\n\n<p><strong>1st Method: Using Data Patch<\/strong><br>In this method, we must create a data patch file as&nbsp;<strong>CreateAttributes.php<\/strong>&nbsp;in our Custom Magento 2 attribute module Setup folder.<\/p>\n\n\n\n<p><strong>Note:<\/strong>&nbsp;You can also use the different file names and class names.<br><strong>complete path: app\/code\/Webkul\/CustomAttribute\/Setup\/Patch\/Data\/CreateAttributes.php<\/strong><\/p>\n\n\n\n<p>Learn more about <a href=\"https:\/\/developer.adobe.com\/commerce\/php\/development\/components\/declarative-schema\/patches\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Data and Schema Patches<\/a><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace Webkul\\CustomAttribute\\Setup\\Patch\\Data;\n\nuse Magento\\Framework\\Setup\\Patch\\DataPatchInterface;\nuse Magento\\Customer\\Setup\\CustomerSetupFactory;\nuse Magento\\Customer\\Model\\Customer;\nuse Magento\\Eav\\Model\\Entity\\Attribute\\SetFactory as AttributeSetFactory;\nuse Magento\\Framework\\Setup\\ModuleDataSetupInterface;\n\nclass CreateAttributes implements DataPatchInterface\n{\n    \/**\n     * @var ModuleDataSetupInterface\n     *\/\n    private $moduleDataSetup;\n\n    \/**\n     * @var CustomerSetupFactory\n     *\/\n    protected $customerSetupFactory;\n\n    \/**\n     * @var AttributeSetFactory\n     *\/\n    private $attributeSetFactory;\n\n    \/**\n     * @param ModuleDataSetupInterface $moduleDataSetup\n     * @param CustomerSetupFactory $customerSetupFactory\n     * @param AttributeSetFactory $attributeSetFactory\n     *\/\n    public function __construct(\n        ModuleDataSetupInterface $moduleDataSetup,\n        CustomerSetupFactory $customerSetupFactory,\n        AttributeSetFactory $attributeSetFactory\n    ) {\n        $this-&gt;moduleDataSetup = $moduleDataSetup;\n        $this-&gt;customerSetupFactory = $customerSetupFactory;\n        $this-&gt;attributeSetFactory = $attributeSetFactory;\n    }\n\n    \/**\n     * Add eav attributes\n     *\/\n    public function apply()\n    {\n        \/** @var CustomerSetup $customerSetup *\/\n        $customerSetup = $this-&gt;customerSetupFactory-&gt;create(&#091;&#039;setup&#039; =&gt; $this-&gt;moduleDataSetup]);\n\n        $customerEntity = $customerSetup-&gt;getEavConfig()-&gt;getEntityType(&#039;customer&#039;);\n        $attributeSetId = $customerEntity-&gt;getDefaultAttributeSetId();\n\n        \/** @var $attributeSet AttributeSet *\/\n        $attributeSet = $this-&gt;attributeSetFactory-&gt;create();\n        $attributeGroupId = $attributeSet-&gt;getDefaultGroupId($attributeSetId);\n\n        $customerSetup-&gt;addAttribute(Customer::ENTITY, &#039;custom_customer_attribute&#039;, &#091;\n            &#039;type&#039; =&gt; &#039;varchar&#039;,\n            &#039;label&#039; =&gt; &#039;Custom Attribute&#039;,\n            &#039;input&#039; =&gt; &#039;text&#039;,\n            &#039;required&#039; =&gt; false,\n            &#039;visible&#039; =&gt; true,\n            &#039;user_defined&#039; =&gt; true,\n            &#039;position&#039; =&gt; 999,\n            &#039;system&#039; =&gt; 0,\n        ]);\n\n        $attribute = $customerSetup-&gt;getEavConfig()-&gt;getAttribute(Customer::ENTITY, &#039;custom_customer_attribute&#039;)\n        -&gt;addData(&#091;\n            &#039;attribute_set_id&#039; =&gt; $attributeSetId,\n            &#039;attribute_group_id&#039; =&gt; $attributeGroupId,\n            &#039;used_in_forms&#039; =&gt; &#091;&#039;adminhtml_customer&#039;],\/\/you can use other forms also &#091;&#039;adminhtml_customer_address&#039;, &#039;customer_account_edit&#039;, &#039;customer_address_edit&#039;, &#039;customer_register_address&#039;, &#039;customer_account_create&#039;]\n        ]);\n\n        $attribute-&gt;save();\n    }\n\n    \/**\n     * Get dependencies\n     *\/\n    public static function getDependencies()\n    {\n        return &#091;];\n    }\n\n    \/**\n     * Get Aliases\n     *\/\n    public function getAliases()\n    {\n        return &#091;];\n    }\n}<\/pre>\n\n\n\n<p><br><strong>2nd Method: Using the InstallData file<\/strong><br>Create the file <strong>app\/code\/Webkul\/CustomAttribute\/Setup\/InstallData.php<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace Webkul\\CustomAttribute\\Setup;\n\nuse Magento\\Customer\\Setup\\CustomerSetupFactory;\nuse Magento\\Customer\\Model\\Customer;\nuse Magento\\Eav\\Model\\Entity\\Attribute\\Set as AttributeSet;\nuse Magento\\Eav\\Model\\Entity\\Attribute\\SetFactory as AttributeSetFactory;\nuse Magento\\Framework\\Setup\\InstallDataInterface;\nuse Magento\\Framework\\Setup\\ModuleContextInterface;\nuse Magento\\Framework\\Setup\\ModuleDataSetupInterface;\n\nclass InstallData implements InstallDataInterface\n{\n    \/**\n     * @var CustomerSetupFactory\n     *\/\n    protected $customerSetupFactory;\n    \n    \/**\n     * @var AttributeSetFactory\n     *\/\n    private $attributeSetFactory;\n    \n    \/**\n     * @param CustomerSetupFactory $customerSetupFactory\n     * @param AttributeSetFactory $attributeSetFactory\n     *\/\n    public function __construct(\n        CustomerSetupFactory $customerSetupFactory,\n        AttributeSetFactory $attributeSetFactory\n    ) {\n        $this-&gt;customerSetupFactory = $customerSetupFactory;\n        $this-&gt;attributeSetFactory = $attributeSetFactory;\n    }\n \n    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)\n    {\n        \/** @var CustomerSetup $customerSetup *\/\n        $customerSetup = $this-&gt;customerSetupFactory-&gt;create(&#091;&#039;setup&#039; =&gt; $setup]);\n\n        $customerEntity = $customerSetup-&gt;getEavConfig()-&gt;getEntityType(&#039;customer&#039;);\n        $attributeSetId = $customerEntity-&gt;getDefaultAttributeSetId();\n\n        \/** @var $attributeSet AttributeSet *\/\n        $attributeSet = $this-&gt;attributeSetFactory-&gt;create();\n        $attributeGroupId = $attributeSet-&gt;getDefaultGroupId($attributeSetId);\n\n        $customerSetup-&gt;addAttribute(Customer::ENTITY, &#039;custom_cust_attribute&#039;, &#091;\n            &#039;type&#039; =&gt; &#039;varchar&#039;,\n            &#039;label&#039; =&gt; &#039;Custom Attribute&#039;,\n            &#039;input&#039; =&gt; &#039;text&#039;,\n            &#039;required&#039; =&gt; false,\n            &#039;visible&#039; =&gt; true,\n            &#039;user_defined&#039; =&gt; true,\n            &#039;position&#039; =&gt; 999,\n            &#039;system&#039; =&gt; 0,\n        ]);\n\n        $attribute = $customerSetup-&gt;getEavConfig()-&gt;getAttribute(Customer::ENTITY, &#039;custom_cust_attribute&#039;)\n        -&gt;addData(&#091;\n            &#039;attribute_set_id&#039; =&gt; $attributeSetId,\n            &#039;attribute_group_id&#039; =&gt; $attributeGroupId,\n            &#039;used_in_forms&#039; =&gt; &#091;&#039;adminhtml_customer&#039;],\/\/you can use other forms also &#091;&#039;adminhtml_customer_address&#039;, &#039;customer_account_edit&#039;, &#039;customer_address_edit&#039;, &#039;customer_register_address&#039;, &#039;customer_account_create&#039;]\n        ]);\n\n        $attribute-&gt;save();\n    }\n}<\/pre>\n\n\n\n<p>InstallData conforms to InstallDataInterface, which requires implementing the install method that accepts two parameters of type ModuleDataSetupInterface and ModuleContextInterface.<\/p>\n\n\n\n<p>Using the addAttribute method on the instance of Magento\\Customer\\Setup\\CustomerSetupFactory, we are instructing Magento to add several attributes.<\/p>\n\n\n\n<p>Note:&nbsp;The module\u2019s&nbsp;<strong>module.xml<\/strong>&nbsp;file must have&nbsp;<strong>setup_version<\/strong>&nbsp;to create a customer custom attribute using&nbsp;InstallData check <a href=\"https:\/\/store.webkul.com\/Magento-2.html\"><strong>How to create a module in Magento 2<\/strong><\/a>.<\/p>\n\n\n\n<p>After adding these files,&nbsp;run the following command in your magento2 root directory through the terminal.<br><strong>php bin\/magento setup:upgrade<\/strong><\/p>\n\n\n\n<p>That is all for the How to Create Customer Custom Attribute in Magento 2. Hope it will help you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here we will learn, How to create a Customer Custom Magento 2 attribute. Note: We also have a separate module (Magento 2 Custom Registration Fields) that allows the admin to create custom customer fields. Henceforth, using the Custom Magento 2 attribute module you can extend your customer sign-up form. For more information, you can check <a href=\"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":69,"featured_media":39671,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[302],"tags":[2769,2770,2768,2771],"class_list":["post-41400","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-magento2","tag-create-customer-attribute-in-magento-2-0","tag-custom-attribute-in-magento-2-0","tag-customer-attribute-in-magento2","tag-magento-2-create-attribute-programmatically"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Create Customer Custom Attribute in Magento 2<\/title>\n<meta name=\"description\" content=\"Learn How to Create Customer Custom Attribute in Magento 2 to add more information about your customers in online store.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create Customer Custom Attribute in Magento 2\" \/>\n<meta property=\"og:description\" content=\"Learn How to Create Customer Custom Attribute in Magento 2 to add more information about your customers in online store.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2016-02-19T14:56:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-28T15:02:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/01\/Magneto-Code-Snippet-3.png\" \/>\n\t<meta property=\"og:image:width\" content=\"825\" \/>\n\t<meta property=\"og:image:height\" content=\"260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Mahesh Singh\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mahesh Singh\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/\"},\"author\":{\"name\":\"Mahesh Singh\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/53d3b977a0ab5adcf32aef9f97e595bd\"},\"headline\":\"How to Create Customer Custom Attribute in Magento 2\",\"datePublished\":\"2016-02-19T14:56:52+00:00\",\"dateModified\":\"2025-01-28T15:02:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/\"},\"wordCount\":265,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/01\/Magneto-Code-Snippet-3.png\",\"keywords\":[\"Create customer attribute in magento 2.0\",\"Custom Attribute in Magento 2.0\",\"Customer Attribute in Magento2\",\"Magento 2 Create attribute programmatically\"],\"articleSection\":[\"Magento2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/\",\"url\":\"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/\",\"name\":\"How to Create Customer Custom Attribute in Magento 2\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/01\/Magneto-Code-Snippet-3.png\",\"datePublished\":\"2016-02-19T14:56:52+00:00\",\"dateModified\":\"2025-01-28T15:02:33+00:00\",\"description\":\"Learn How to Create Customer Custom Attribute in Magento 2 to add more information about your customers in online store.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/01\/Magneto-Code-Snippet-3.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/01\/Magneto-Code-Snippet-3.png\",\"width\":825,\"height\":260},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Create Customer Custom Attribute in Magento 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/53d3b977a0ab5adcf32aef9f97e595bd\",\"name\":\"Mahesh Singh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f4c013ebf7008223382b8a49203e6d354677e8baff0eca373e6e4266efa762da?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f4c013ebf7008223382b8a49203e6d354677e8baff0eca373e6e4266efa762da?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Mahesh Singh\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/mahesh721\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Create Customer Custom Attribute in Magento 2","description":"Learn How to Create Customer Custom Attribute in Magento 2 to add more information about your customers in online store.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/","og_locale":"en_US","og_type":"article","og_title":"How to Create Customer Custom Attribute in Magento 2","og_description":"Learn How to Create Customer Custom Attribute in Magento 2 to add more information about your customers in online store.","og_url":"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2016-02-19T14:56:52+00:00","article_modified_time":"2025-01-28T15:02:33+00:00","og_image":[{"width":825,"height":260,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/01\/Magneto-Code-Snippet-3.png","type":"image\/png"}],"author":"Mahesh Singh","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Mahesh Singh","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/"},"author":{"name":"Mahesh Singh","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/53d3b977a0ab5adcf32aef9f97e595bd"},"headline":"How to Create Customer Custom Attribute in Magento 2","datePublished":"2016-02-19T14:56:52+00:00","dateModified":"2025-01-28T15:02:33+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/"},"wordCount":265,"commentCount":4,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/01\/Magneto-Code-Snippet-3.png","keywords":["Create customer attribute in magento 2.0","Custom Attribute in Magento 2.0","Customer Attribute in Magento2","Magento 2 Create attribute programmatically"],"articleSection":["Magento2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/","url":"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/","name":"How to Create Customer Custom Attribute in Magento 2","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/01\/Magneto-Code-Snippet-3.png","datePublished":"2016-02-19T14:56:52+00:00","dateModified":"2025-01-28T15:02:33+00:00","description":"Learn How to Create Customer Custom Attribute in Magento 2 to add more information about your customers in online store.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/01\/Magneto-Code-Snippet-3.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/01\/Magneto-Code-Snippet-3.png","width":825,"height":260},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/how-to-create-customer-custom-attribute-in-magento-2-0\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Create Customer Custom Attribute in Magento 2"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/53d3b977a0ab5adcf32aef9f97e595bd","name":"Mahesh Singh","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/f4c013ebf7008223382b8a49203e6d354677e8baff0eca373e6e4266efa762da?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f4c013ebf7008223382b8a49203e6d354677e8baff0eca373e6e4266efa762da?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Mahesh Singh"},"url":"https:\/\/webkul.com\/blog\/author\/mahesh721\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/41400","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/69"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=41400"}],"version-history":[{"count":16,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/41400\/revisions"}],"predecessor-version":[{"id":476430,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/41400\/revisions\/476430"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media\/39671"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=41400"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=41400"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=41400"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}