Magento 2 Import of Custom Attributes: How to Import Products with Custom Attributes to Magento 2

- E-Commerce, Magento 2

magento 2 import custom attributes

When you import products to Magento 2, you may face various difficulties. Transferring them to your website without headaches is possible if all items suit the Magento 2 requirements. However, when Magento 2 custom attributes enter the game, merchants usually experience difficulties. So, let’s talk about the Magento 2 import of custom attributes. The following article provides several tips on importing products with custom attributes to Magento 2.

Below, you will find various recommendations on how to streamline this process. First of all, we shed light upon how to enable the Magento 2 product import if you have to deal with custom attributes, avoiding the most common errors. After that, you will find a short guide on how to automate the procedure. Next, the article touches upon the topic of missing attributes. We explain how to create them on the fly automatically. And of course, products bound to third-party categories are also a topic of our discussion. We describe how to match them to the ones you use in your e-commerce catalog. More useful tips are available here: Developer’s Cookbook.

Table of contents

Magento 2 Custom Attributes Defined

In Magento, an attribute is a property that can help you describe entities: orders, products, customers, etc. Magento 2 custom attributes, in turn, extend the meaning of an entity far beyond the standard attributes. Let’s look at product attributes. They describe specific product characteristics and provide additional information for your website. Magento 2 product attributes determine the input type used for product options and participate as search parameters in layered navigation.

Magento lets you create multiple custom attributes and assign values to them. Each attribute, however, can be associated with only one input type. At the same time, you can go with a set of default product attributes, such as SKU, Weight, Price, Status, etc. You can edit the default Magento 2 attributes, but it is impossible to delete them.

When it comes to Magento 2 custom attributes, you can create any other product attribute, like size or color, to extend the default product characteristics. For instance, you can add the following Magento 2 custom attributes for climbing shoes: Outsole, Rand, Closure, etc. You will help customers choose a product that perfectly suits their demands by introducing these additional parameters.

magento 2 import custom attributes: custom attribute example with a climbing shoe

Now, that you are familiar with Magento 2 custom attributes, let’s return to the main topic of our article – the Magento 2 import of custom attributes as a part of a product update.

Import Products with Custom Attributes to Magento 2 without Errors

You can import products with custom attributes to Magento 2, applying the same algorithm as the one you use with products that incorporate default attributes. But there is a notable exception that we’ve discovered in this discussion on StackExchange. While you can use the same mechanisms and tools, you should keep in mind that some custom attributes may lead to errors, disrupting data transfers. 

Ankit Shah detailly described his import case here. The author of the discussion exported a file with product data and wanted to reimport it back. However, the system displayed the following error: 

Value for ‘product_type’ attribute contains incorrect value

To make the long story short, we won’t rewrite all the conditions the author faced since they don’t make any difference from the perspective of our guide. The only thing we want to draw your attention to is the cause of the problem. 

A custom product attribute became a reason for the failed import. The author used a custom attribute called Product Type. As you might have guessed, its code was ‘product_type,’ which is also utilized by the same default attribute. As a result, Magento 2 recognized the custom attribute as a system one and applied the corresponding requirements to its values. However, the custom attribute utilized values that were not supported by default, causing the error.

To solve this problem, the author had to rename the custom attribute. After that, the issue was fixed, so Ankit freely imported products with custom attributes to Magento 2. 

If you don’t want to get into the same situation, we recommend you avoid reserved words when you create custom attributes in Magento 2. In other words, don’t use names that are already utilized by the system. You can see all default product attributes and their values here: Magento 2 Product Attribute Reference. Learn them before importing products with custom attributes to Magento 2.

Automated Magento 2 Import of Products with Custom Attributes

A general product import workflow in Magento 2 looks as follows:

  1. You go to the Magento 2 Admin > System -> Import.
  2. Select “Products” from the “Entity Type” dropdown. 
  3. Select an import behavior option.
  4. Check the data and upload a CSV file. 

While it is intuitive and straightforward, you cannot automate the process. It is necessary to repeat the same actions every time you want to import products with custom attributes to Magento 2. Use the Improved Import & Export Magento 2 extension to automate the procedure. While it offers a similar general workflow, our module also provides the ability to use schedules to transfer all types of products with custom attributes automatically. And it is fully suitable for the Adobe Commerce import of custom attributes!

The extension utilizes cron to power the feature. You can create custom intervals or select predefined ones. At the same time, profiles with no schedule are still an option. You can launch import whenever you want using asynchronous updates. The schedule configuration looks as follows:

magento 2 import custom attributes: automation

Magento 2 Import of Custom Attributes: Products with Third-Party Attributes

If your product data file contains not only custom attributes but also third-party system ones, you cannot import it using the default Magento 2 tools. However, the Improved Import & Export Magento 2 extension comes in handy again. The module offers mapping presets that modify third-party data according to the rules of Magento 2. You only need to select a predefined scheme suitable for your integration to let our plugin replace all external attributes with ones used internally. As for custom attributes, they stay untouched, while the Improved Import & Export plugin modifies a custom data file, making it suitable for import. The process looks as follows:

magento 2 import custom attributes: mapping presets

You can use the following add-ons to import products with custom attributes to Magento 2 modifying the corresponding third-party values:

  • WooCommerce Migration Add-on lets you seamlessly migrate from WordPress to Magento 2, transferring all the necessary product data. No programming skills are required to import WooCommerce products, customers, addresses, and orders.
  • MS Dynamics Integration Add-on provides the ability to connect Magento 2 to MS Dynamics Business Central ERP/CRM and synchronize product data between them.
  • Banggood Dropshipping Add-on introduces the easiest ways to start a dropshipping business with Magento 2. With this tool, you can connect your e-commerce store to the Banggood catalog and transfer product data to Magento 2.

More add-ons are available here: Magento 2 Extensions by Firebear.

Alternatively, it is possible to use an interface where you can prepare products with both custom and third-party attributes manually. Just choose an external system attribute and specify a replacement. You can apply similar actions to product attribute values. With Improved Import & Export, it is no longer a problem to map and edit them in bulk.  

Import Products with Custom Attributes and Third-Party Categories to Magento 2

Another mapping feature that lets you import products with custom attributes to Magento 2 is related to categories. When you transfer data from third-party systems, the module enables you to replace external category names with ones utilized internally. The process looks as follows:

magento 2 import custom attributes: category mapping

And you can generate new on the fly. Choose a parent category first and then specify a new one. Next, the extension will connect products to this category. Check the following article for further information: Category Mapping.

Magento 2 Import of Products with Custom Attributes When Some Attributes Are Not Available

If your data file lacks some attributes, you can freely transfer it into the system using the Improved Import & Export Magento 2 extension. The module enables you to create attributes on the fly. So if a file with custom product attributes lacks some system ones, it is no longer a problem. You can specify the parameters necessary to generate the missing data automatically. The feature is described here: Product attributes import.

Magento 2 Import of Custom Attributes in Different Formats

While Magento 2 lets you import data as CSV files only, the Improved Import & Export extension dramatically extends the default functionality. In addition to CSV, the module supports XML, Json, XLSX, ODS, and ZIP & TAR. It means that there is no need to convert files to CSV. Furthermore, the extension lets you import any XML file to Magento 2 based on XSLT instructions.

As for Json, this feature enables Rest API transfers and opens further opportunities than the default import tool offers. The ability to import Excel and OpenOffice formats to Magento 2 lets you transfer them via XSL, XSLX, and ODS tables. 

Furthermore, you can import products with custom attributes in supported file formats even when they are compressed. The extension supports ZIP & TAR archives and can unpack them automatically. You can transfer the information from the following sources:

  • REST and SOAP API;
  • Google Sheets;
  • Direct URL;
  • FTP/SFTP;
  • Dropbox;
  • Direct File Upload.

In addition to ALL product types, Improved Import & Export lets you transfer all the core Magento 2 entities, including Orders, Categories, Customers, Advanced Pricing, Product Attributes, Catalog & Cart Price Rules, Search Terms and Synonyms, etc.

Magento 2 Custom Attributes Import FAQ

If you still have questions regarding importing products with custom attributes, pay attention to the following Q&A sections.

How do we import products with custom attributes to Magento 2 via API?

By default, Magento 2 neither lets you import products with custom attributes nor transfer other entities via APIs. But you can get the desired functionality with the Improved Import & Export extension. It lets you transfer products with custom attributes to Magento 2 via API. The module lets you create the connection between the two systems moving the corresponding data.

How do we import products with custom attributes to Magento 2 via ODS files?

If your products with custom attributes are stored in an ODS file, say no more! The Improved Import & Export Magento 2 extension will help you to transfer them to your e-commerce website. While Magento 2 works with CSV files only, our module exceeds the existing barriers by adding support for other file formats.

How do we import products with custom attributes to Magento 2 via XLSX files?

If your products with custom attributes are stored in an XLSX file, say no more! The Improved Import & Export Magento 2 extension will help you to transfer them to your e-commerce website. While Magento 2 works with CSV files only, our module exceeds the existing barriers by adding support for other file formats.

How do we import products with custom attributes to Magento 2 via JSON files?

If your products with custom attributes are stored in a JSON file, say no more! The Improved Import & Export Magento 2 extension will help you to transfer them to your e-commerce website. While Magento 2 works with CSV files only, our module exceeds the existing barriers by adding support for other file formats.

How do we import products with custom attributes to Magento 2 in a compressed file?

If products with custom attributes are stored in a file archive, you can also transfer them to Magento 2 with the help of the Improved Import & Export extension. The module works with ZIP and TAR formats. Note that your archives should contain a CSV, XML, ODS, XLSX, or JSON file.

How do we import products with custom attributes to Magento 2 from Google Sheets?

You can also use the Improved Import & Export extension to import products with custom attributes to Magento 2 from Google Sheets. Specify the corresponding table as your import source, providing its URL.

How do we import products with custom attributes to Magento 2 from Dropbox?

In addition to Google Sheets, the Improved Import & Export module works with several cloud storages. Thus, it lets you transfer products with custom attributes to Magento 2 from Dropbox. Your data should be stored in a CSV, XML, ODS, XLSX, or JSON format. Note that files of these types can be compressed in a ZIP or TAR format.

How do we import products with custom attributes to Magento 2 from Google Drive?

In addition to Google Sheets and Dropbox, you can leverage Google Drive to import products with custom attributes. The Improved Import & Export module lets you transfer files from this cloud storage. You have to deal with CSV, XML, ODS, XLSX, or JSON formats. If they are compressed, it should be a ZIP or TAR file.

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

According to various publications, you can mass update attributes in Magento 2 by importing products. However, we recommend you use the Improved Import & Export extension for this purpose since it offers way more flexible settings for that. The extension lets you update product attributes in bulk, applying changes straight to the records that should be modified. You need to select attributes as your import entity and choose the add/update import job behavior.

How to import csv with several attributes to Magento?

As you’ve just seen in the article above, the Improved Import & Export module provides the ability to import a CSV file with several attributes to Magento 2. Also, you can leverage such file formats as XML, XLSX, ODS, and JSON. If your attributes are stored in Google Sheets, the extension can also move them into your e-commerce website. Alternatively, the plugin lets you generate an API connection to import any entity to Magento 2 from any external point.

How do we import attribute values into Magento 2?

With the default Magento import tool, you can import neither attributes nor their values. As for the Improved Import & Export extension, it enables both functionalities. You can not only transfer attribute values to your Magento 2 installation but also map them to the existing records.

How do we import yes/no attributes to Magento?

Since the Improved Import & Export module lets you import attributes of all types, yes/no attributes are not an exception. You can find the yes/no attributes in the Magento 2 product attributes import table. Take a look at our Google Sheet Master Table to see their exact placement.

How do we remove attribute values during Magento 2 product import?

The Improved Import & Export module lets you delete attribute values during the Magento 2 import by adding the option:delete_values column to your import file. In this column, you need to specify the attribute values you want to delete. The attribute itself stays unchanged. Practically, it works as follows: you specify values that have to be removed, for instance, green, red, and yellow for the attribute ‘color’.

How do we export product attributes in Magento 2?

We’ve just described numerous nuances of product import processes in Magento 2, but what about exporting data? The Improved Import & Export extension lets you export products with custom attributes from Magento 2. Create a new export job, choose the corresponding export entity, and provide other parameters of your new transfer.

Final Words

Magento 2 custom attributes are no longer a problem if you use the proper names. Don’t utilize the system attribute names to specify your custom ones. Thus, you will avoid import errors. If you want to simplify data transfers of products with custom attributes even more, use the Improved Import & Export Magento 2 extension. Our module lets you automate import processes moving all the data you need. Even the Adobe Commerce import of custom attributes is possible!

Besides, the extension lets you replace third-party attributes and unsupported values when you import products with custom attributes to Magento 2. You can freely restore the missing data due to the ability to create attributes on the fly. At the same time, Improved Import & Export lets you import products with attribute values using various file formats and sources so that you are no longer limited to CSV and file uploads. For further information, follow the link below:

Get Improved Import & Export Magento 2 Extension