{"id":444,"date":"2019-05-31T09:32:16","date_gmt":"2019-05-31T09:32:16","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/2019\/05\/31\/create-product-attribute-in-magento-2\/"},"modified":"2025-07-22T17:28:33","modified_gmt":"2025-07-22T11:58:33","slug":"create-product-attribute-in-magento-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/create-product-attribute-in-magento-2\/","title":{"rendered":"How to Create Product Attribute in Magento 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A product attribute defines a characteristic of the product, it is a property of the product.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For online stores, the product attributes becomes utmost important to display the product online in as many ways as possible. The product attributes help merchants offer the products in the most detailed way possible. Also, it makes easy for the visitors to browse through the products, filter them and find the exact item as per their need.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">By default, Magento 2 provides product attributes but you can also create one! You can also&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/add-comment-text-for-product-attributes-magento\/\">add comment text for product attributes<\/a>&nbsp;in Magento 2 that facilitates providing additional guidance regarding the input field such as how it will be used.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Magento 2 product attributes can be created while creating a product, or from the product attribute page.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here, I\u2019ll give the step-wise method to&nbsp;<em><strong>create product attribute in Magento 2<\/strong><\/em>&nbsp;from Stores menu.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The steps are in accordance with the latest&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/magento-2-3-1-release\/\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2.3.1<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Steps to Create Product Attribute in Magento 2:<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Enter the basic properties<\/li>\n\n\n\n<li>Enter the advanced properties<\/li>\n\n\n\n<li>Enter the Field Label<\/li>\n\n\n\n<li>Enter the Store Front properties<\/li>\n\n\n\n<li>Save<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Implement each step as shown below:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Enter the basic properties<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Log in<\/strong>&nbsp;to Admin Panel<\/li>\n\n\n\n<li>Navigate to&nbsp;<strong>Stores &gt; Attributes &gt; Product<\/strong><\/li>\n\n\n\n<li>Click \u201c<strong>Add New Attribute<\/strong>\u201c<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2019\/05\/1_Product-Attributes-Grid.png\" alt=\"1_Product Attributes Grid\" class=\"wp-image-5680\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<ul start=\"4\" class=\"wp-block-list\">\n<li>Under&nbsp;<strong>Attributes Properties<\/strong>,\n\n\n\n\n\n\n<ul class=\"wp-block-list\">\n<li>Enter a&nbsp;<strong>Default Label<\/strong>&nbsp;to identify the attribute.<\/li>\n\n\n\n<li>In the \u201c<strong>Catalog Input Type for Store Owner\u201d<\/strong>&nbsp;field, set type in input control to be used for data entry.\n<ol class=\"wp-block-list\">\n<li>If you had selected drop-down or multiple select input types:\n<ol class=\"wp-block-list\">\n<li>Under \u201c<strong>Manage Options<\/strong>\u201c, click \u201c<strong>Add Options<\/strong>\u201c<\/li>\n\n\n\n<li>Enter the first value that you want to appear on the list. You can enter one value for the Admin, and a translation of the value for each store view. If you have only one store view, you can enter only the Admin value and it will be used for the storefront as well.<\/li>\n\n\n\n<li>Repeat the previous step for each option to be included in the list.<\/li>\n\n\n\n<li>For the option to be used as the default value, select \u201c<strong>Is Default<\/strong>\u201c<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Enter a&nbsp;<strong>Default Label<\/strong>&nbsp;to identify the attribute.<\/li>\n\n\n\n<li>In the \u201c<strong>Catalog Input Type for Store Owner\u201d<\/strong>&nbsp;field, set type in input control to be used for data entry.\n<ol class=\"wp-block-list\">\n<li>If you had selected drop-down or multiple select input types:\n<ol class=\"wp-block-list\">\n<li>Under \u201c<strong>Manage Options<\/strong>\u201c, click \u201c<strong>Add Options<\/strong>\u201c<\/li>\n\n\n\n<li>Enter the first value that you want to appear on the list. You can enter one value for the Admin, and a translation of the value for each store view. If you have only one store view, you can enter only the Admin value and it will be used for the storefront as well.<\/li>\n\n\n\n<li>Repeat the previous step for each option to be included in the list.<\/li>\n\n\n\n<li>For the option to be used as the default value, select \u201c<strong>Is Default<\/strong>\u201c<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Enter a&nbsp;<strong>Default Label<\/strong>&nbsp;to identify the attribute.<\/li>\n\n\n\n<li>In the \u201c<strong>Catalog Input Type for Store Owner\u201d<\/strong>&nbsp;field, set type in input control to be used for data entry.\n<ol class=\"wp-block-list\">\n<li>If you had selected drop-down or multiple select input types:\n<ol class=\"wp-block-list\">\n<li>Under \u201c<strong>Manage Options<\/strong>\u201c, click \u201c<strong>Add Options<\/strong>\u201c<\/li>\n\n\n\n<li>Enter the first value that you want to appear on the list. You can enter one value for the Admin, and a translation of the value for each store view. If you have only one store view, you can enter only the Admin value and it will be used for the storefront as well.<\/li>\n\n\n\n<li>Repeat the previous step for each option to be included in the list.<\/li>\n\n\n\n<li>For the option to be used as the default value, select \u201c<strong>Is Default<\/strong>\u201c<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Enter a&nbsp;<strong>Default Label<\/strong>&nbsp;to identify the attribute.<\/li>\n\n\n\n<li>In the \u201c<strong>Catalog Input Type for Store Owner\u201d<\/strong>&nbsp;field, set type in input control to be used for data entry.\n<ol class=\"wp-block-list\">\n<li>If you had selected drop-down or multiple select input types:\n<ol class=\"wp-block-list\">\n<li>Under \u201c<strong>Manage Options<\/strong>\u201c, click \u201c<strong>Add Options<\/strong>\u201c<\/li>\n\n\n\n<li>Enter the first value that you want to appear on the list. You can enter one value for the Admin, and a translation of the value for each store view. If you have only one store view, you can enter only the Admin value and it will be used for the storefront as well.<\/li>\n\n\n\n<li>Repeat the previous step for each option to be included in the list.<\/li>\n\n\n\n<li>For the option to be used as the default value, select \u201c<strong>Is Default<\/strong>\u201c<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Set \u201cYes\u201d to \u201c<strong>Values Required\u201d<\/strong>&nbsp;if you want to require the customer to choose an option before the product can be purchased.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2019\/05\/2_attribute-properties.png\" alt=\"2_attribute properties\" class=\"wp-image-5681\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">2. Enter the advanced properties<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Set a&nbsp;<strong>unique attribute code<\/strong>. It should be lowercase characters without any spaces.<\/li>\n\n\n\n<li>Select the&nbsp;<strong>scope<\/strong>&nbsp;from Store View, Website, or Global to indicate where in the store the attribute s allowed to be used.<\/li>\n\n\n\n<li>Enable the field \u201c<strong>Unique Value<\/strong>\u201d to avoid duplicate values.<\/li>\n\n\n\n<li>With \u201c<strong>Input Validation for Store Owner<\/strong>\u201d field, you can validate the data entered in the text field.<\/li>\n\n\n\n<li>Set the \u201c<strong>Add to Column Option<\/strong>\u201d to \u201cYES\u201d to add this attribute to the list of column options<\/li>\n\n\n\n<li>Set the \u201c<strong>Use in Filter Option<\/strong>\u201d to \u201cYES\u201d to add the attribute to the list of filter options.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2019\/05\/3_Advanced-Attribute-Properties.png\" alt=\"3_Advanced Attribute Properties\" class=\"wp-image-5682\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">3. Enter the Field Label<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Go to \u201c<strong>Manage Labels<\/strong>\u201d under Attribute Information<\/li>\n\n\n\n<li>Expand \u201c<strong>Manage Titles<\/strong>\u201c<\/li>\n\n\n\n<li>Enter a&nbsp;<strong>Title&nbsp;<\/strong>to be used as a label for the field. In the case of multi-language support, enter the title for each view.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2019\/05\/4_Manage-Titles.png\" alt=\"4_Manage Titles\" class=\"wp-image-5683\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">4. Enter the Store Front properties<\/h3>\n\n\n\n<ul start=\"4\" class=\"wp-block-list\">\n<li>Go to &#8220;<strong>Store Front Properties<\/strong>&#8221;&nbsp;under <strong>Attribute Information<\/strong><\/li>\n\n\n\n<li>Enable the &#8220;<strong>Use in Search<\/strong>&#8221; field for the attribute to be available for search.<\/li>\n\n\n\n<li>Enable &#8220;<strong>Comparable on Storefront<\/strong>&#8221; field to include it in product comparison.<\/li>\n\n\n\n<li>For catalog input field to be drop down, multiple select or price:\n<ul class=\"wp-block-list\">\n<li>Set &#8220;Use in Layered Navigation&#8221; to &#8220;YES&#8221; to use the attribute as a filter in layered navigation.<\/li>\n\n\n\n<li>Set &#8220;<strong>Use in Search Results Layered Navigation&#8221;<\/strong>&nbsp;to \u201cYes\u201d to use the attribute in layered navigation on search results pages.<\/li>\n\n\n\n<li>Set the relative position of the attribute in the layered navigation block in &#8220;<strong>Position<\/strong>&#8220;.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Enable&#8221;<strong>Use for Promo Rule Conditions<\/strong>&#8221; field to use the attribute in price rules.<\/li>\n\n\n\n<li>Enable &#8220;<strong>Allow HTML Tags on Storefront<\/strong>&#8221; field to allow the text to be formatted with HTML and use WYSIWYG editor<\/li>\n\n\n\n<li>Enable the &#8220;<strong>Visible on Catalog Pages on Storefront<\/strong>&#8221; field to make the attribute visible in catalog page listing.<\/li>\n\n\n\n<li>If Product Listing is supported with your theme, the attribute can be appeared and used as sort parameter by enabling &#8220;<strong>Used in Product Listing<\/strong>&#8216; and &#8220;<strong>Used for Sorting in<\/strong> <strong>Product Listing<\/strong>\u201c<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2019\/05\/5_Storefront-properties.png\" alt=\"5_Storefront properties\" class=\"wp-image-5684\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">5. Save<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Click the &#8220;<strong>Save Attribute<\/strong>&#8221; button to save the configuration.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">That was it!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can also refer to Create Product Attribute in Magento 2 from our <a href=\"https:\/\/www.youtube.com\/playlist?list=PLBTOxSAJzwEjM5MilmEqj98Ib80tKBu7r\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 video tutorial<\/a> series:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"How to Create Product Attribute in Magento 2\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/fs2bC6bfXiE?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You can see the custom_attribute created and listed in the Product Attribute grid:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2019\/05\/6_New-attribute-created-Products-Attribute-Grid-1024x396.png\" alt=\"6_New attribute created - Products Attribute Grid\" class=\"wp-image-5685\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to implement the programmatic solution to create product attribute, check our blog&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/create-product-category-cms-page-attributes-in-magento-2\/\" target=\"_blank\" rel=\"noreferrer noopener\">Create Product, Category and CMS Page Attributes in Magento 2<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A product attribute defines a characteristic of the product, it is a property of the product. For online stores, the product attributes becomes utmost important&#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-444","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/444","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=444"}],"version-history":[{"count":2,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/444\/revisions"}],"predecessor-version":[{"id":15400,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/444\/revisions\/15400"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=444"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=444"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}