How to Import & Export Product Attributes for Magento 2

- E-Commerce, Magento 2

import export product attributes for magento 2

Do you know how to import attributes in Magento 2? It’s a complex process that covers not only product attributes but also attribute groups and attribute sets. In the following article, you will learn how to import and export product attributes for Magento 2 in the most efficient way. We discuss how the attributes behave and which values from an import table Magento 2 understands. Why is this topic important? 

Well, it would be much easier if you could just import products, moving all the corresponding data in a single CSV. However, Magento doesn’t even support product positions in a category within a product CSV. 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. Note that it also supports the Magento 2 import of custom attributes. Below, we provide a table with product attributes and their descriptions to help you understand what’s going on in a CSV with attributes. Also, you will find a step-by-step guide to the import of attributes in Magento 2.  

There Is No Import of Attributes in Magento 2

As we’ve already mentioned, Magento 2 doesn’t let you import product attributes by default. It means that you need to recreate them manually in some situations. The more attributes you have to compose, the more time it is necessary to spend on them. But what if there is a more straightforward solution? 

The import and export of product attributes look like the most obvious resolution for Magento 2. But it’s only available via third-party solutions.

The lack of a transparent Magento 2 import of product attributes is among multiple reasons FireBear Studio created the Improved Import and Export extension. Our tool can easily handle imports and exports for both Magento 2 EAV and custom attributes. The module even lets you move the corresponding information to a separate Google Sheet spreadsheet, where you can edit it together with your colleagues. Add new attributes, change attribute values, remove irrelevant data, and then import attributes back to the Magento 2 store at the scheduled time and date. 

You can find more information about the Improved Import and Export extension on its product page. If you require detailed instructions on how to use the extension, read its User Manual. But let’s continue with the import of attributes in Magento 2.

Magento 2 Import of Product Attributes You Can Get

The Magento 2 import of product attributes is similar to importing products, customers, or other entities:

  • Get a table with attributes you want to import.
  • Learn how to edit the table to make it suitable for Magento 2 (if it is not yet suitable).
  • Import the attributes to Magento 2.

That’s it! Now, let’s start from the very beginning – the content of the import attributes Magento 2 CSV.

Magento 2 Product Attributes CSV (Import Table)

You can find the most extensive selection of sample CSV files in our Google Sheet Master Table. In addition to attributes and sample values, this project also contains descriptions of the data specified there. 

If you want to compose a table with import attributes for Magento 2 from scratch, use the following table since it describes attributes and values you should add to a CSV file to import product attributes to Magento 2.

Attribute Name Reference Values Value Example
store_id Required column.

The 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 the Admin value of the attribute.

For attribute values for other store views use the 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.

The value can’t contain spaces or contain more than 30 symbols. Color
frontend_label  Default Label of the attribute. Consider it 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 an attribute ‘color’ may be: red, green, or yellow. Yellow
option:value Required column.

Attribute option value. 

Visible on the front end.

For example, for an attribute ‘color’ may be: red, green, or yellow. Yellow
option:swatch_value Defines the HTML color value of the swatch attribute, or a path to the image in reference to the 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 a 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 the attribute set the attribute belongs to. Can be any value First attribute group
group:sort_order Position of the attribute group within the 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 customers 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 the store administrator.

Means it is a system attribute.

1 – can be defined by the 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 the 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, an attribute is visible in the grid

0 – no, attribute is invisible

1
is_searchable Use in Search. Is the attribute available in the 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 the 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 an advanced search. 1 – visible

0 – not visible

1
position Position of an attribute in the 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 an attribute is required in the main store. 1 – yes

0 – no

0
is_used_in_grid An attribute is used in the product grid. 1 – yes

0 – no

1
is_visible_in_grid An attribute is visible in the product catalog. 1 – visible

0 – hidden

0
is_filterable_in_grid An attribute is filterable in the 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, or yellow. Green
additional_data Additional attribute data.

How to Import Magento 2 Product Attributes

Once the Improved Import & Export Extension is installed, you can find new sections in your admin under System -> Improved Import / Export. It’s where you import and export product attributes for Magento 2.

import attributes magento 2

Follow these steps to import product attributes to Magento 2:

  1. Go to System -> Improved Import / Export -> Import Jobs.
  2. Click the ‘Add New Job’ button to create a new job.
    import attributes magento 2: add new import job
  3. In the first section, specify the job name and set the job schedule if you want to import product attributes to Magento 2 automatically.
    import attributes magento 2: automation
  4. Proceed to the Import Settings section. Select the entity you want to import to your Magento 2 store – Attributes.
    import attributes magento 2
  5.  Then, specify the behavior of the import job: add/update, replace, or delete. Select the behavior carefully and proceed.
    import attributes magento 2: import behavior
  6. Now, it’s time to choose a file format and source of your product attribute table. Note that it can be either the standard CSV format or something more specific, such as XML, JSON, ODS, or XLSX.
    When it comes to file sources, the Improved Import & Export provides the ability to import attributes to Magento 2 from Google Sheets, Google Drive, over FTP/SFTP, or even via API.
    import attributes magento 2: file format selection
  7. Once you’ve selected the file from the specified source, hit the ‘Validate file’ button. If your file is correct, you can click the ‘Save & Run’ button followed by ‘Run’ to start the import job.
  8. Once the import is finished you will get a log with information about how the import went.
    import attributes magento 2

This Magento 2 product attribute import process allows you to achieve the following goals:

  • Create attributes and attribute values. Attribute values are created automatically according to the values you specify in the import table.
  • Create attribute sets. If the attribute you import belongs to an attribute set that doesn’t exist – a new attribute set is created based on the default attribute set.
  • Create attribute groups. Attribute groups within attribute sets can be also created automatically.

You can freely use the Improved Import & Export extension for the Magento 2 import of custom attributes.

Important to Know

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

Note that you cannot change system attributes to user-defined. Magento 2 does not allow such changes.

Also, pay attention to the value of the is_visible attribute. If its value is ‘0’, the attribute will not be visible in the attribute grid of the administrator panel after import.

You can find more aspects of an import process in the Improved Import and Export manual.

Magento 2 Export of Product Attributes That Works

The Magento 2 export of product attributes takes place under System > Export Jobs. Here you need to:

  1. Create a new export job and decide on its frequency;
  2. Select the ‘Entity‘ you want to export – ‘Attributes‘;
    magento 2 import export product attributes: export
  3. Decide on file format – CSV, XML, Excel, JSON, etc. – and field separators (if necessary);
  4. Choose a source to export Magento 2 attributes: FTP/SFTP, Google Drive, manual download, Google Sheets, etc.
  5. Apply necessary attribute mapping and filters if applicable.
  6. Once done setting up the export job, click the ‘Save and Run button at the upper right corner of the screen.
  7. Next, hit the ‘Run‘ button to export product attributes from Magento 2.

As a result, you will get a CSV table with all product attributes available in your database. Note that this process is also suitable for exporting custom product attributes from Magento 2.

You can find more aspects of an export process in the Improved Import and Export manual.

Magento 2 Import Export Product Attributes FAQ

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

Although numerous techniques 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 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.

Final Words

While neither the import nor export of attributes is a part of the built-in platform’s functionality, you can easily get the missing functionality with the Improved Import & Export Magento 2 extension. The latter enables the import and export of product attributes for Magento 2 users. The module lets you transfer product attributes, attribute groups, and attribute sets. You can use import processes to create attributes and attribute values, generate new attribute sets, and combine new attribute groups. Unveil the full potential of the Magento 2 import of product attributes with Firebear. Follow this link for more information: Improved Import & Export Extension.