You can import product images into Magento 2 using the Magento 2 Import feature. Here are the steps to follow:
- Prepare the images: Make sure the product images you want to import are in the correct format (JPEG, PNG, or GIF) and that they are named according to the SKU of the product they belong to. For example, if the SKU of the product is
PROD-001
, the main image should be namedPROD-001.jpg
. - Create a CSV file: Create a CSV file that includes the product SKUs and the file paths of the corresponding images. You can use a spreadsheet program such as Excel or Google Sheets to create the file. The CSV file should include the following columns:
sku
,base_image
,small_image
,thumbnail_image
,additional_images
. - Upload the images: Upload the product images to the correct directory on your server. By default, product images are stored in the
pub/media/catalog/product
directory. - Upload the CSV file: Upload the CSV file to the root directory of your Magento 2 store.
- Start the import process: In your Magento 2 admin panel, go to
System > Data Transfer > Import
. SelectProducts
as the Entity Type, and choose the CSV file you uploaded. Click on theCheck Data
button to verify that the data in the CSV file is valid. - Map the image columns: In the Import Settings section, expand the
Advanced Settings
tab and select theImages File Directory
value aspub/media/catalog/product
. Next, go to theImages File Mapping
section and map the image columns to the correct image types. For example, map thebase_image
column to thebase_image
attribute. - Run the import process: Click on the
Import
button to start the import process. Magento 2 will import the product data and images from the CSV file.
Note that if you have a large number of images to import, the import process may take some time to complete. It’s also important to make sure that the image file paths in the CSV file are correct and that the images are uploaded to the correct directory on the server.