How to Import Product Images into Magento 2 in Bulk

- Fire development, Magento 2

magento 2 import product images

Below, we describe how to import product images in Magento 2 using CSV. Since it is a part of a product import routine, you will only need to learn a couple of aspects.

Of course, you can add images to product pages one by one but what if there are thousands of items on your storefront? In this case, manual upload doesn’t seem to be a good idea. However, there are two methods described in the official documentation that dramatically simplify the Magento bulk image import. First of all, you can leverage a local server to upload product images to Magento 2 in bulk.

Secondly, the system lets you use a remote server for this purpose. However, both methods incorporate the default data transfer instruments of Magento 2. Since they are a little bit limited, you can use the Improved Import & Export extension to import product images to Magento 2. Let’s see how the default methods look and what benefits our module offers. Visit our Magento 2 Developer’s Cookbook to discover other useful tips.

How to Import Product Images in Magento 2

Below, we explain how to import product images in magento 2 using a CSV file if you use a local or remote server.

Local Server

If you use a local server to upload images to your e-commerce website, follow these steps:

  1. Upload images to the server. Go to the Magento server and upload image files to the pub/media/import folder for earlier Magento versions. If you use Adobe Commerce and Magento Open Source 2.3.2 or newer versions, upload images to the var/import/images folder or a subfolder, such as var/import/images/product_images.
  2. Configure CSV data. Enter each image file name to be imported on the correct row, by SKU, and in the correct column according to image type. You have to deal with the following image types: base_image, small_image, thumbnail_image, or additional_images. Note that you have to avoid the path before the filename then you specify image names in the CSV file. As for the Magento 2 product images import CSV structure, it consists of the SKU column and the related image columns. It’s a default platform’s requirement
    magento 2 import multiple images per product csv
  3. Import the CSV to Magento. Next, you need to import your CSV as you would normally do with a standard Magento 2 product import: select a CSV file and specify the path to the directory with images (/pub/media/import or var/import/images depending on your Magento version). Starting from 2.3.2, you can leave the Images File Directory field blank to use the <Magento-root-folder>/var/import/images directory.

magento 2 import product images

Now, let’s say a few more words about importing multiple product images for a single SKU in Magento 2. You need to upgrade your CSV file as follows: 

  • Add the additional_images column to your CSV file;
  • Specify image names there.
    Use commas to separate multiple image names, e.g., img2.jpg,img3.jpg.

Now, you know how to import product images to Magento 2 from a local server. Let’s see what to do if visual materials are stored on an external server.

External Server

If you rely on an external server for your update, follow these steps to import product images to Magento 2:

  1. Upload images to the server. Go to the external server, create a folder (or use the existing one), and upload images.
  2. Configure CSV data. Enter the full URL for each image (such as https://yourexternalserver.com/images/image.jpg) in the corresponding columns following the image type (types are the same as mentioned in the previous method).
  3. Import the CSV to MagentoFollow the same standard product routine as mentioned above.

For further information, check this Magento 2 Importing Product Images User Guide.

Enhanced Magento 2 Import of Multiple Images per Product CSV

Alternatively, install the Improved Import Magento 2 extension by Firebear. It allows importing images to Magento 2 in bulk from remote FTP, Dropbox, or direct URL! You also need to prepare a CSV file and follow the import routine. Let’s take a closer look. 

Magento 2 Product Image Import CSV

As an attribute, the product image, whether it is a base, thumbnail, or any other kind, is tightly connected to the product SKU and Attribute Set. These are the primary attributes required for composing a data table for product image import. Below, you can find them described:

Attribute Name Reference Values Value Example
sku A unique value that is used to identify the product. The only mandatory field. SKU is the first field of the table and cannot be removed.

Supports letters, numbers, and signs “-“, “_”.Can be up to 64 characters in length. Can not contain white spaces. 

Mind the letter case!

You can find SKUs for products already in the catalog at Catalog > Products.

downloadable-1
attribute_set_code Defines Attribute Set assigned to the product. It should look exactly the same as an attribute set name including capital letters (e.g. “Default”, “Man shoes” etc.)

Attribute set name can be found under Stores > Attribute Set

attibute_set_code – is the default value for this column.

This is also a mapping column containing ALL available product attributes, in case you need a quick reference to map data.

default
Base_image, 

additional_images, 

small_image, 

thumbnail_image, 

swatch_image (in case the product image is used as a Magento 2 swatch)

Use these columns to specify the file names of any additional images or URLs, to be associated with the product. Should be separated with commas.

Image files should be uploaded to  /pub/media/import.

The path of /sample_data/m/b/mb01-blue-0.jpg has the following structure: /pub/media/import/sample_data/m/b/mb01-blue-0.jpg

Or you can use a direct URL of an image, such as http://site.com/images/some_image.jpg

http://site.com/images/

some_image.jpg

Don’t forget that our extension supports image import with the following additional attributes: base_image_label, additional_image_labels, small_image_label, thumbnail_image_label, and swatch_image_label. Add the corresponding columns to your image import CSV to specify the alt text to your product images.

Magento 2 Product Image Import Process

Now, let’s see how to import product images to Magento 2 with the Improved Import and Export extension:

  1. Go to System > Improved Import / Export > Import Jobs and press the “Add New Job” button.
    magento 2 import product images: add new job

  2. In the first section, specify the job name and set the job schedule if you want to import product images to Magento 2 automatically.
    magento 2 import product images: general settings and automation

  3. Next, proceed to the Import Settings section to select the entity you want to import to – Products.
    magento 2 import product images: select entity
  4.  Then, specify the behavior of the import job: Add/Update, Replace, or Delete. If you want to add images to the existing products, continue with Add/Update.
    magento 2 import product images: import behavior
  5. Now, it’s time to choose a file format and source of your file with Magento 2 color swatches. Note that the Improved Import and Export extension supports both the standard CSV format along with XML, JSON, ODS, or XLSX.
    When it comes to file sources, the module provides the ability to import product images to Magento 2 from Google Sheets, Google Drive, over FTP/SFTP, or even via API.
    magento 2 import product images: import source

  6. Once you’ve selected the file from the specified source, hit the ‘Validate file’ button. If your product image file is correct, click the ‘Save & Run’ button followed by ‘Run’ to start the import job.
    magento 2 import product images: import run
  7. Once the import is finished you will get a log with information about how the import went.

You can find more nuances associated with the Magento product image import process here: Improved Import & Export Extension Manual. Also, contact us to get help with your Magento 2 product updates.

 Get Improved Import and Export

Magento 2 Product Image Import FAQ

Below, we provide answers to questions that Magento 2 users often ask regarding the benefits of image import with the Improved Import & Export Magento 2 extension.

How to import product images to Magento 2 automatically?

If you need to transfer product images to Magento 2 regularly, it is necessary to install a third-party tool. Unfortunately, the default import/export solutions don’t let you create import jobs that run on schedule. Therefore, we recommend you use the Improved Import & Export extension to import product images to Magento 2 automatically. The extension leverages cron so that you can create a schedule of updates. Next, the module does everything for you.

How to import product images to Magento 2 from external systems?

While the default Magento 2 import mechanisms block the import of third-party data that doesn’t follow the system’s requirements, you can use the Improved Import & Export extension to circumvent these restrictions. The module lets you create a mapping scheme matching any external values to the default Magento 2 attributes. Consequently, any external data is easily adapted to the native standards of your e-commerce website. The most intriguing aspect is that you do everything right in your admin.

How to import product images to Magento 2 via API?

Use the Improved Import & Export Magento 2 extension to import product images to Magento 2 via API. Our extension lets you create the connection between the two systems transferring any data, including product images. Any import job provides an interface where you can specify the parameters necessary to put the two systems together.

How to import product images to Magento 2 via ODS files?

If the product image data is stored in an ODS file, you no longer need to convert it to a CSV file to fit the Magento 2 requirements. With the Improved Import & Export Magento 2 extension, it is possible to import ODS files to your ecommerce website without any necessity to run the conversion.

How to import product images to Magento 2 via XLSX files?

If the product image data is stored in an XLSX file, you no longer need to convert it to a CSV file to fit the Magento 2 requirements. With the Improved Import & Export Magento 2 extension, it is possible to import XLSX files to your ecommerce website without any necessity to run the conversion.

How to import product images to Magento 2 via JSON files?

If the product image data is stored in an ODS file, you no longer need to convert it to a CSV file to fit the Magento 2 requirements. With the Improved Import & Export Magento 2 extension, it is possible to import JSON files to your ecommerce website without any necessity to run the conversion.

How to import product images to Magento 2 via compressed files?

If the product image data is stored in a compressed file, you can also transfer it to Magento 2 with the help of the Improved Import & Export extension. However, there are two requirements to follow. Firstly, your file archive should be in a ZIP or TAR format. Secondly, the compressed data should be stored in a CSV, XML, ODS, XLSX, or JSON file.

How to import product images to Magento 2 from Google Sheets?

If your product image data is stored in Google Sheets, it is no longer a problem. There is no need to export it from the service and then transfer the output to Magento 2. The Improved Import & Export lets you move the corresponding information straight from Google Sheets to your e-commerce website. It is only necessary to specify the address of the corresponding data table.

How to import product images to Magento 2 from Dropbox?

In addition to Google Sheets, the Improved Import & Export module lets you transfer product images to Magento 2 from Dropbox. Your data should be stored in CSV, XML, ODS, XLSX, or JSON. If it is a compressed file, it should be in a ZIP or TAR format.

How to import product images to Magento 2 from Google Drive?

In addition to Google Sheets and Dropbox, the Improved Import & Export module lets you transfer product images to Magento 2 from Google Drive. Your data should be stored in CSV, XML, ODS, XLSX, or JSON. If it is a compressed file, it should be in a ZIP or TAR format.

Final Words

Images are an irreplaceable means of product visualization. And while you can easily keep smaller catalogs up to date, large rosters require a vast amount of time and effort to stay neat and updated. A standard management routine may extend in time much longer than one can expect. That’s why Improved Import and Export introduces the enhanced Magento 2 product image import routine. Maximum automation of product image import helps you save resources during migrations, synchronizations, and any kind of database updates. However, the platform’s default importer is enough if you need to import a couple of product images to Magento 2 from a local or remote server. Anyway, check our extension to discover more advantages over the default Magento 2 import and export:

 Get Improved Import and Export