How to import Magento 2 product and custom attributes

In this article, we talk about how to import product attributes, attribute groups, and attribute sets to a Magento 2 store. Besides, we discuss how the attributes behave and which values Magento 2 understands in the import tables. The topic is extremely important since transferring products to Magento 2 is impossible without product attributes. They dictate which values the products have and which options and variations exist. That’s why having the ability to import product attributes is a must. Since Magento 2 doesn’t let you import product attributes by default, we use the Improved Import & Export extension to manage all the processes. Below, you will find how the module works when it comes to the Magento 2 product attribute import. We provide a table with product attributes, offer tips on importing attributes to your e-commerce website, and highlight several more important aspects. 

This blog post is a part of FireBear Studio GuideList to Magento 2 import and export processes. In the Guide List you can find answers and detailed instructions on how to import any entity to your Magento 2. Every guide features a complete sample import table for Magento 2 with every attribute explained.

Read Magento 2 import and export Guide List

Table of contents

How to import product attributes to Magento 2

As you probably know, and why are you reading this article, Magento 2 doesn’t let you import product attributes. That’s why FireBear Studio developed and is constantly updating Improved Import and Export extension for Magento 2, which CAN import and export Magento 2 EAV and custom attributes.

With Improved Import and Export extension for Magento 2 you can import and export product attributes. Edit these attributes in a separate Google Sheet with your colleagues. Add new or remove irrelevant and import attributes back to Magento 2 store at the scheduled time and date. This can be pretty handy when you are building new supplier chain.

More information about Improved Import and Export extension can be found at the product page. If you require detailed instructions on how to use the extension –  read User Manual.

How it works

In this chapter we will refer to working with Improved Import and Export extension. If you want to follow the instructions along and do not have the extension yet – please – use the Live Demo.

The attribute import goes the same way you are importing products, customers or other stuff to your Magento 2:

  • First, you need a table with attributes.
  • Second, you need to know how to edit the table and which values are supported for attributes.
  • Third, you need to import the attributes with Improved Import and Export extension.

Let’s start from the beginning and talk about the table and how it looks.

Magento 2 product attributes import table

We try to gather sample import tables for all import entities supported by Improved Import and Export extension in the Google Sheet Master Table. By the link, you can find a sample table for importing product attributes. You can use it as a starting point for completing your own table.

If you want to compose your own table from the scratch, below you can find all attributes and sample values you will need to use when importing attributes to your Magento 2.

Attribute name Reference Values Value example
store_id Required column.

ID of the store view the attribute value belongs to.

When creating new attributes make sure to have store_id=0 for every unique value.

store_id=0 is responsible for Admin value of the attribute.

For attribute values for other store views use required store_id.

You can find store_id in the URL of the store view at Stores > All Stores > select required store view.

0
attribute_code Required column.

Attribute Code used for internal identification purposes.

Value can’t contain spaces or contain more than 30 symbols. Color
frontend_label  Default Label of the attribute. Consider it a an attribute name, when browsing the list of attributes. Can be any value Green color
option:base_value Required column

Attribute ADMIN option value. Is used to reference other store view values of the attribute to the ADMIN value.

For example, for attribute ‘color’ it may be: red, green, yellow. Yellow
option:value Required column.

Attribute option value. 

Visible on frontend.

For example, for attribute ‘color’ it may be: red, green, yellow. Yellow
option:swatch_value Defines the HTML color value of the swatch attribute, or a path to the image in reference with Magento 2 root folder. HTML color code: mesh and numerals.

Or an image link. 

The path to the image files should have the following look:

/var/images/image.jpg

#3a6638

/var/images/image.jpg

option:sort_order Order in which attribute option values are displayed. The lower the value, the higher the value is displayed.

Note that if you plan to use your attribute for a configurable product, this column is mandatory and needs to be set up correctly. Otherwise, you won’t be able to create configurable products with the attribute (true for Magento 2.3.4 or 2.3.5)

Priority of the attribute. Numerals only 10
entity_type Attribute entity Always product product
attribute_set Required column.

Name of the attribute set the attribute belongs to.

You can create NEW attribute sets by specifying unique value in this column.

You can find attribute_set values at Stores > Attributes > Attribute Set. default
group:name Name of the attribute group within attribute set the attribute belongs to. Can be any value First attribute group
group:sort_order Position of the attribute group within attribute set relative to other groups. Priority of the attribute group. Numerals only 10
backend_type Optional. Database value. Change only if you know what you are doing.
backend_table Optional. Database value. Change only if you know what you are doing.
frontend_model  Optional. Database value. Change only if you know what you are doing.
frontend_input Catalog Input Type for Store Owner.

Defines how customer can choose attribute values.

Some of the input types do not require values. Like boolean – Yes/No. The values are available automatically.

Can be:

text – Text Field

textarea – Text Area

date – Date

boolean – Yes/No

multiselect – Multiple Select

select – Dropdown, Visual or Text Swatch

price – Price

media_image – Media Image

wee – Fixed Product Tax

multiselect
frontend_class Optional. Database value. Change only if you know what you are doing.
source_model Optional. Database value. Change only if you know what you are doing.
is_required Values Required. Defines if the attribute value must be selected in any case. 1 – yes, required value

0 – no, value is not required

1
is_user_defined  Defines if it is a system attribute – that cannot be changed by the administrator. 0 – can’t be defined by store administrator.

Means it is system attribute.

1 – can be defined by store administrator.

Generally, you want all custom attributes to be editable. With is_user_defined=1

1
default_value  Defines if this row, this attribute option is selected by default. 1 – default attribute value

Leave blank if the value is not default

1
is_unique Unique Value, not shared with other attributes.

Attribute setting.

1 – is unique

0 – not unique

1
frontend_input_renderer Optional. Database value. Change only if you know what you are doing.
is_global Scope of the attribute. 1 – Global

2 – Website

3 – Store view

0
is_visible Use in Filter Options – defines if the attribute is available for search in the product grid. 1 – yes, attribute is visible in grid

0 – no, attribute is invisible

1
is_searchable Use in Search. Is attribute available in search. 1 – yes, available

0 – no, not available

0
is_filterable Use in Layered Navigation. Defines if the attribute can be used in layered navigation. 1 – yes, can be used

0 – no, cannot be used

1
is_comparable Comparable on Storefront. 1 – yes, comparable

0 – no, not comparable

0
is_visible_on_front Visible on Catalog Pages on Storefront. 1 – visible

0 – hidden

1
is_html_allowed_on_front    Allow HTML Tags on Storefront. 1 – allow

0 – disallow

0
is_used_for_price_rules Can be used for price rules. 1 – yes

0 – no

1
is_filterable_in_search   Use in Search Results Layered Navigation. 1 – yes

0 – no

0
used_in_product_listing     Used in Product Listing. 1 – yes

0 – no

1
Used_for_sort_by Used for Sorting in Product Listing. 1 – yes

0 – no

0
is_visible_in_advanced_search Defines if the attribute is visible in advanced search. 1 – visible

0 – not visible

1
position Position of attribute in layered navigation block. The lower the value, the higher the position.

Can only contain numerals.

10
is_wysiwyg_enabled Use for Promo Rule Conditions. 1 – yes

0 – no

0
is_used_for_promo_rules Use for Promo Rule Conditions. 1 – yes

0 – no

1
is_required_in_admin_store   Defines if attribute is required in main store. 1 – yes

0 – no

0
is_used_in_grid Attribute is used in product grid. 1 – yes

0 – no

1
is_visible_in_grid Attribute is visible in product catalog. 1 – visible

0 – hidden

0
is_filterable_in_grid Attribute is filterable in product catalog. 1 – yes

0 – no

1
search_weight Defines the weight of the attribute in search. The higher the value, the higher the weight.

Can only contain numerals.

10
option:delete_values Contains the attribute value you want to delete DURING THE IMPORT.

Doesn’t remove the attribute itself from the database.

The row where you specify the value for removal doesn’t affect the attribute of the line or relate to it    

For example, for attribute ‘color’ it may be: red, green, yellow. Green
additional_data Additional attribute data.

Once you installed the extension you can find new export and export sections in the administrator panel, under System.Creating an import jobNow that you which attributes of the attributes (no pun intended) to use, you can start composing and importing your own attributes using Improved Import and Export extension for Magento 2.

Here you need to select Import Jobs. That’s where you create and manage all the import jobs, set schedule and configure the import job execution. Export jobs are pretty similar, however with particular differences. If you want a full featured guide – read Improved Import and Export manual.

At the import jobs grid you get control over the basic job settings.

To create a new job click ‘Add New Job’ button. In the first section of the import job you will need to specify the job name for internal identification purposes and set the job schedule, if intend to run it automatically.

There are also other settings we omit in this guide. For the full settings description proceed to the extension manual.

In the next section you are suggested to select the entity you want to import to your Magento 2 store. In this guide we are importing attributes.

Then, you need to select the behavior of the import job: add/update, replace or delete. Select the behavior carefully and proceed to uploading the table with attributes.

Here you are suggested to specify the type of the file you will be importing. And selecting from where you want to import. Available sources include file upload, FTP/SFTP, Google Sheets, direct url and Rest/Soap APIs.

Once you selected the file from the specified source, hit ‘Validate file’ button and that’s it. You can now hit big orange ‘Save & Run’ button to start the import job.

Once the import is finished you will get a success log with information about how the import went.

Tips on importing attributes to Magento 2

With attribute import you can:

  • Create attributes and attribute values.
  • Create attribute sets. If the attribute you are importing belongs to attribute set that doesn’t exist – new attribute set will be created based on default attribute set.
  • Create attribute groups. Attribute groups within attribute sets can be also created automatically.
  • Attribute values will be created automatically according to the values you specify the import table.
  • You cannot change system attribute to user defined. Magento 2 does not allow such changes.
  • Pay attention to is_visible value. If the value will be ‘0’ the attribute will not be visible in the attribute grid of the administrator panel.

What is important to remember

Column is_user_defined plays very important role. It defines if it is a system attribute, or if user (the store administrator) can edit it manually. When importing attributes – make sure to pay attention to the value you specify.

Guide list

If you are looking for the guides on how to import other entities to Magento 2, or require step-by-step instructions with explanations on every product type – don’t forget to check on the Magento 2 import guide list.

Read Magento 2 import guide list

Magento 2 Product Attribute Import FAQ

How to use product import to mass update attributes in Magento 2?

Although there are numerous techniques that describe how to mass update attributes in Magento 2, including ones based on the product import and the default data transfer solution, we recommend you to use the Improved Import & Export for this purpose. The extension lets you mass update attributes in Magento 2. You apply changes straight to the product attributes you want instead of transferring other entities that deliver the desired impact. Just choose attributes as your import entity and select the add/update import job behavior. Thus, you will mass update attributes in Magento 2 without using product import.

How to import csv with several attributes to Magento?

You can easily import a CSV file with several attributes to Magento 2 with the help of the Improved Import & Export Magento 2 extension. The module lets you transfer attributes in other file formats, including XMl, XLSX, ODS, and JSON. If your attributes are stored in Google Sheets, the module can also import them from this platform. Besides, you can create an API connection to import any amount of attributes to Magento 2 from any external source.

How to import attribute values into Magento 2?

While the default import tools of Magento 2 let you import neither attributes nor their values, you can use Improved Import & Export for that. The extension not only lets you transfer attribute values to your Magento 2 installation but also provides the ability to map them to the existing ones. For instance, you want to transfer attribute values that are not supported in Magento 2 but the platform uses similar designations. The Improved Import & Export extension lets you teach the system what attribute values to use to replace the unsupported data.

Where are yes and no attributes stored in the Magento import CSV?

Peruse the Magento 2 product attributes import table to find the exact position of yes and no attributes in the Magento import CSV. You may also take a look at our Google Sheet Master Table. The corresponding link is available above.

How to import yes/no attributes to Magento?

Since the Improved Import & Export extension can import all possible attributes and values to your e-commerce storefront, you can use it to import yes/no attributes to Magento 2.

How to remove attribute values on catalog import to Magento 2?

You can add option:delete_values to your import file. This column contains the attribute values you want to delete during the import process. Note that it doesn’t remove the attribute itself. The row where you specify the value for removal doesn’t affect the attribute of the line or relate to it. For instance, you can remove red, green, yellow, or other similar attribute values for attribute ‘color’.

How to export product attributes in Magento 2?

The Improved Import & Export extension lets you export attributes and attribute values from Magento 2. Create a new export job and specify attributes as your export entity. Configure other transfer parameters and launch your export profile to transfer attributes from Magento 2.

Related posts

Discover more from WHO WILL CARE eCommerce

Subscribe now to keep reading and get access to the full archive.

Continue reading