Magmi: How to import images to Magento

Table of Content

Magmi allows to import images to Magento, use Image attributes processor for this task.

What can do Magmi Image attributes processor:

  • import images, small images, thumbnails and media gallery;
  • import image from both, local path and URLs;
  • include/exclude images for the product;
  • re-name image by pattern;
  • attach labels to images;

Base image columns

  • image
  • small_image
  • thumbnail

Base image label columns:

  • image_label (label to use for image)
  • small_image_label (label to use for small_image)
  • thumbnail_label (label to use for thumbnail image)

Extra images column

  • media_gallery – allows to import as much product images as you want.

Since several images can be set in this column, a specific syntax has been set to handle labels.

  • extended syntax with :: for setting labels only applies to media_gallery column;
  • to set base image label use image label related columns;

media_gallery (extra images) column syntax

 <image1 location>[::image1 label];<image2 location>[::image2 label]
Example without labels
Example with labels

Include/exclude image

By default Magmi marks all images as excluded. Excluded means you will see images in admin panel, but won’t be able to see them on frontend. You should mark images as included manually in admin panel. The simplest way to make the image included just add "+" sign before image path.


The opposite to the "+" Magmi uses "-" sign to exclude the image.


Image path

Server source

By default, Magmi searches images under media/import path relative to project root directory. It can be changed with Image search path in configuration:


Magmi includes really handy helper that allows downloading images directly by URLs. It doesn’t require any configuration, just place full URL instead of relative image path and Magmi automatically download that image from a remote server and will do all manual work.

Image renaming

Sometimes may happens that images placed in different paths but have the same names. Then the collision will happen and the different products can have the same images. To avoid this use Image renaming.

Predefined meta variables

  • {item.sku} – product SKU;
  • {meta.imageindex} – image order index;
  • {meta.imagename.ext} – image extension.

The final renaming rule can have next view:


This will rename image to something like this: DD-12345_0.jpg.


Say your images are located like this:

thumbs/01.png standard/01.png

So you surely have data with columns

image => ‘standard/01.png’ thumbnail => ‘thumbs/01.png’

Since those are not the same images, regex replace may be a good way to "rename" image depending on its container directory.

You can now set the following formula in image renaming:


Then "standard/01.png" value will be renamed as 01_standard.png in magento and "thumbs/01.png" will be renamed as 01_thumbs.png in Magento, thus avoiding conflicts & overwriting.

Before start, it’s worth nothing that this will not work for images in the “media_gallery” column, only the "image", "small_image" and "thumbnail" columns.

If we look at the example, let’s break this up into pieces:


This says “rewrite”.

The next part:


Is the folder name that is then called by “$1”, eg “thumbs”

The next part:


Is the actual image name, eg “01”

And the next part is:


Which is the image file name, eg “.jpg”

Then the final part is the rewriting:


Which in English says “image name” + “_. (underscore and a full stop)” + “folder name” + “extension”

Hence why we go from “thumbs/01.png” to “01_thumbs.png

So if this isn’t working for you, then it is that you’re not just importing a image value similar to “thumbs/01.png” into your small_image etc… columns.

You as well can use predefined variables in regex, for example:


FIle example

Only the store and sku columns are required, any others are optional. Below is available full example of CSV file:

store sku image small_image thumbnail media_gallery
admin 001300-9000-BTU + + + +;+;+
admin 001300-12000-BTU + + + +;+;+

Full file example is available in Google Sheets.

Useful links

Leave a Reply

Your email address will not be published. Required fields are marked *