Following are some of the errors you may have encountered while importing products with images:
Server request block (Error getting remote image)
While importing images using URLs that are residing in an external server, you may have come across errors like ‘Error getting the remote images’ in your log file.
Most of the time, image fetch failure may occur due to the server request blocking issue. The server in which you have hosted your images may not allow access to retrieve the images.
If you have encountered this issue while migrating your site, we would recommend to go for the following method.
- While exporting you will get options to export images as separate zip or to use the URL in the CSV. The best practice would be to export the images as a separate zip.
- After exporting images as a zip file, extract that zip to the /wp-content/uploads/directory and then provide the image name in the CSV file.
In cases other than migration, you will have to probably identify the reason for the server block and get it resolved.
Also, ensure that valid or direct image URLs are specified instead of any publicly hosted one to get rid of this issue.
Duplicate entry in Media Library
The duplication entry of images may occur in two cases:
- Importing multiple products with the same image name in the CSV
If images with same name are being imported, by default, WordPress will treat each image separately and upload it into the media library with the same name in an incremental hyphenated number pattern.
For instance, when you use the same image for different simple products or for each variation in a variable product. However, the exported CSV file will contain multiple image URLs. This will result in duplicate images on your server and slow download time while importing the products. See the screenshot below:
To overcome this, you can provide the respective image name (image-name.jpg) instead of the URL. That is, keep the URL once in the images column, and for the subsequent use of the same image, provide only the image name in the column.
A screenshot of sample CSV is as shown below:
Though this is pretty straightforward in the case of simple products, it can get a bit tricky in the case of variable products.
For example, we have iPhone as a variable product on our store. Based on the attribute “color”, there are two variations: Black and White, which need different images. We have another attribute “storage”, which again creates three variations (16GB, 32Gb, 64GB), but can use the same image.
In this example, we used the same image for variations Black 16GB, Black 32GB, and Black 64GB. Now you can see (above screenshot), we have used the URL only once for the Black variations. Whenever it is repeated in the CSV, we added the image name. And when a different image is used (for the white variations), we added the URL once and just the image-name.jpg in subsequent cases.
2. Updating existing products
If you are about to update existing products using CSV, you can avoid duplicate image entries in either of the following workarounds:
- Unmap the image column on import so that the images are not uploaded again into your site.
- Specify just the image name instead of the complete URL on import. That is, if the images are already uploaded in the media library then you can simply use the image name along with the extension in the CSV for reusing it.
Multiple images not getting imported
If there are multiple images for a product in your CSV file, all the images must be inserted in the images column of the CSV with each image separated by a pipe symbol.
If you are using some other symbols for separating the images or if the images are inserted in different columns, then it is likely that the images are not imported into the site.
To overcome this, you may manually edit the image column in the required manner.
If the images are placed in multiple columns. you can also make use of a filter which will allow you to import multiple images easily without any glitch.