The Best Way to Import Magento Products into WooCommerce
When you import Magento products into WooCommerce, your Magento store keeps selling to customers while you set up the new one. Every order lowers your stock, and any price you change in Magento no longer matches the one you already imported into WooCommerce.
That’s why I don’t treat the import as a one-time job. WP All Import imports the product CSV that Magento already exports, including configurable products and their variations. It can also run the same import again later to update WooCommerce’s prices and stock from a newer Magento export. For this article, my example is a small yoga store, and I’ll keep its WooCommerce products in sync with Magento until the new store goes live.
Where Magento’s Product Data Lands in WooCommerce
Magento and WooCommerce keep track of the same product details, but they don’t always record them in the same way. Most columns in a Magento export hold a single value, and those go straight into matching WooCommerce fields. WP All Import‘s Automatic Setup maps a Magento export’s product names, descriptions, SKUs, prices, weights, and stock levels to WooCommerce on upload, without requiring any setup notes.
The columns that need more care are the ones where Magento packs several details together or follows its own rules.
Magento export › WooCommerce
| Magento column | What it holds | What it becomes in WooCommerce |
|---|---|---|
product_type and configurable_variations | configurable on the parent row, plus the SKU and options of every variation | A variable product with its variations |
additional_attributes | Each variation’s options, such as color=Sage,mat_thickness=4mm | Attributes such as Color and Thickness |
categories | The full path, starting with Magento’s root category: Default Category/Yoga/Mats | Yoga › Mats |
product_online | 1 for enabled, 2 for disabled | Published or draft |
base_image and additional_images | Paths inside Magento’s media folder, such as /g/r/grip-mat-sage.jpg | Featured image and gallery |
My yoga store sells a mat in two thicknesses and three colors. In its Magento export, each of the six variations has a row of its own, and none of those rows names the mat as its parent. Only the mat’s own row lists them. WP All Import’s Function Editor reads these packed columns while the import runs, so you don’t have to go through the hassle of splitting them apart in a spreadsheet first.
Export the Product CSV While Magento Stays Live
Exporting products doesn’t take your Magento store offline, so customers can keep shopping while you prepare the WooCommerce store. Adobe Commerce, the paid edition of Magento, uses the same export screen.
Magento export settings at a glance
Magento builds the file in the background and lists it in a grid on the same page, usually within a couple of minutes. If it never appears, the background task that creates export files isn’t running, and whoever manages your Magento server will need to start it.
Your product images need to come across too. Magento keeps them in its pub/media/catalog/product folder, which you can download through your host’s file manager or SFTP. Skip the cache folder inside it, since it only holds resized copies of the same images. Then upload the images to the WordPress Media Library. WP All Import finds each image in the Media Library by its file name, so the image paths in Magento’s export work without any changes.
Import the Magento Products with WP All Import’s Automatic Setup
You’ll need WP All Import Pro and its WooCommerce Import Add-On, which come together in the WooCommerce Import Package. Automatic Setup maps the standard product fields, and Manual Setup is where I tell WP All Import how to read the columns Magento packs together.
Step 1: Upload the Export and Let Automatic Setup Map It
In WordPress, go to All Import › New Import and click Set up automatically at the top of the screen.

On the Upload File tab, choose the CSV you exported from Magento. WP All Import’s Automatic Setup also loads files from a URL or an FTP/SFTP server, which helps if your Magento host can share the export that way.

Next, pick WooCommerce › Products. Leave Add Setup Instructions empty, because the Magento columns that need extra handling get set up in Manual Setup. Then click Start Automatic Setup.

On the Your Import Is Ready screen, check the record count against your export. WP All Import’s Automatic Setup counts each row of a Magento export as one record, so a configurable product with six variations adds seven records to the import. My file shows 9 records, because two simple products sit alongside the mat. Scroll through Field Mappings to see where each Magento column went.

Click Manual Setup to open the drag-and-drop editor. Every mapping Automatic Setup made is already filled in there.
Step 2: Add the Magento Helpers in the Function Editor
Open the Function Editor section on the Manual Setup screen. It already contains the opening and closing PHP tags, so paste the code below between them.
Magento helper functionsPaste between the PHP tags already in the Function EditorShow codeHide code
// Reads one Magento option from the additional_attributes column, e.g. "color=Sage,mat_thickness=4mm".
// On a parent row, it collects every value listed in configurable_variations instead.
function magento_attribute( $pairs, $code, $variations = '' ) {
if ( trim( $variations ) !== '' ) {
$found = array();
foreach ( explode( '|', $variations ) as $variation ) {
$value = magento_attribute( $variation, $code );
if ( $value !== '' && ! in_array( $value, $found, true ) ) {
$found[] = $value;
}
}
return implode( '|', $found );
}
foreach ( explode( ',', $pairs ) as $pair ) {
$bits = explode( '=', $pair, 2 );
if ( count( $bits ) === 2 && trim( $bits[0] ) === $code ) {
return trim( $bits[1] );
}
}
return '';
}
// Works out a variation's parent SKU by removing its option values from the end,
// so YM-GRIP-4mm-Sage becomes YM-GRIP. Rows that aren't variations return nothing.
function magento_parent_sku( $sku, $visibility, $pairs ) {
if ( trim( $visibility ) !== 'Not Visible Individually' ) {
return '';
}
$values = array();
foreach ( explode( ',', $pairs ) as $pair ) {
$bits = explode( '=', $pair, 2 );
if ( count( $bits ) === 2 && trim( $bits[1] ) !== '' ) {
$values[] = trim( $bits[1] );
}
}
do {
$before = $sku;
foreach ( $values as $value ) {
$suffix = '-' . $value;
if ( strcasecmp( substr( $sku, -strlen( $suffix ) ), $suffix ) === 0 ) {
$sku = substr( $sku, 0, -strlen( $suffix ) );
}
}
} while ( $sku !== $before );
return $sku;
}
// Removes Magento's root category from each path,
// so "Default Category/Yoga/Mats" becomes "Yoga/Mats".
function magento_categories( $paths ) {
$clean = array();
foreach ( explode( ',', $paths ) as $path ) {
$parts = explode( '/', trim( $path ) );
array_shift( $parts );
if ( count( $parts ) > 0 ) {
$clean[] = implode( '/', $parts );
}
}
return implode( '|', $clean );
}
Click Save Functions once the code is in place.

WP All Import’s Function Editor stores PHP functions that any field in the import can call by name. The next two steps use these three to turn Magento’s packed columns into WooCommerce data.
Step 3: Link Each Variation to Its Configurable Parent
A Magento export file’s variation row doesn’t say which product it belongs to. Its SKU still shows it, though. When Magento creates a configurable product’s variations, it builds each variation’s SKU by adding the option values to the end of the parent’s SKU.
In my export, the mat’s SKU is YM-GRIP, and its 4mm Sage variation has the SKU YM-GRIP-4mm-Sage. The magento_parent_sku function from Step 2 removes the option values from the end of each variation’s SKU, which leaves the parent’s SKU for WP All Import to link to. If you renamed your variation SKUs in Magento, they need to keep this pattern for the link to work.
In the WooCommerce Add-On section, make sure that Product Type is set to Variable product. Then open the Variations tab, choose the option where each variation is linked to its parent by the parent’s SKU, and fill in its two fields:
- SKU element for parent: {sku[1]}
- Parent SKU element for variation: [magento_parent_sku({sku[1]},{visibility[1]},{additional_attributes[1]})]

In the Attributes tab, add one row per option and tick In Variations, Is Visible, Is Taxonomy and Auto-Create Terms on each. The quoted word in each formula is the Magento attribute code, so replace it with your own:
- Color: [magento_attribute({additional_attributes[1]},”color”,{configurable_variations[1]})]
- Thickness: [magento_attribute({additional_attributes[1]},”mat_thickness”,{configurable_variations[1]})]

Last, in the Inventory tab, set Manage stock? to Set with XPath and enter [IF({product_type[1][.=’configurable’]})]no[ELSE]yes[ENDIF]. That way, stock is tracked on each variation, not on the parent.
Step 4: Clean Up Categories, Status and Images
In Taxonomies, Categories, Tags, keep the hierarchy settings Automatic Setup chose and change the Product categories value to [magento_categories({categories[1]})]. Leave Separated by as /, tick Separate hierarchy groups via symbol, and enter |. A path such as Default Category/Yoga/Mats then becomes Yoga › Mats.

Under Other Product Options, set Post Status to Set with XPath and enter [IF({product_online[1][.=’2′]})]draft[ELSE]publish[ENDIF]. Anything you disabled in Magento comes in as a draft.
In the Images section, switch to Use images currently in Media Library and leave the image field as Automatic Setup filled it in. WP All Import looks up the file name at the end of each Magento path, so in my instance, /g/r/grip-mat-slate.jpg finds the grip-mat-slate.jpg media file that I uploaded.

Step 5: Set SKU as the Unique Identifier and Run the Import Twice
Click Continue to reach Import Settings. Check that Unique Identifier is {sku[1]}, and untick Skip WooCommerce products if their data in your file has not changed, since the second run reads the same file.

Click Continue and Confirm & Run Import. When Magento’s export lists variations above their parent, as mine does, the first run creates them as separate products, because their parent doesn’t exist yet when the import reaches them. Click Re-Run Import on the completion screen to fix that. The second run updates the same 9 records instead of creating new ones, and this time each variation attaches to its parent.

Running the same WP All Import import a second time attaches Magento variations to their parent products without creating duplicates. My mat now has all six variations, each with its own color and thickness.

On the product page, both options show up as dropdowns, and the gallery holds all three colors.

Keep WooCommerce in Sync with Magento Until Launch Day
Your Magento store keeps selling to customers until the day you fully switch to WooCommerce, so its prices and stock will continue to change after the first import. I don’t set up a new import for each change, because a new import creates products instead of updating the ones already in WooCommerce. Instead, I export a fresh product CSV from Magento and run the same import again, set to update prices and stock only.
Launch timeline
- 1First import, run twice
- 2Build the storefront in Oxygen
- 3Re-run for prices and stockas often as needed
- 4Final re-run on launch day
- 5Point your domain at WooCommerce
To swap in the new export, go to All Import › Manage Imports, open the import’s Settings, and upload the file under Import File. Further down, under Choose which data to update, untick Select All, then tick everything under Price & Stock except the two Sale Price Dates boxes. Include Sale Price, because a sale that ends in Magento would otherwise keep its old price in WooCommerce.

Next, tick Remove or modify WooCommerce products that are not present in this import file, then choose to change their stock status to Out of stock. WP All Import marks products that are missing from a newer Magento export as out of stock instead of deleting them, so their product pages stay in place.

Save the settings and run the import again. My launch-week export had lower prices on the 4mm mats and no cork block, which I’d deleted in Magento. The re-run updated 8 records and set the cork block to Out of stock, without creating any new products.

Re-running a WP All Import import with only Price & Stock selected updates existing WooCommerce products from a newer Magento export and leaves all other product data alone.
Final Thoughts
For me, the best way to import Magento products into WooCommerce is one that lets the Magento store keep selling until launch day, and WP All Import makes that possible. Running the import twice brings the whole catalog across from Magento’s export, with every variation linked to its parent product. After that, each re-run with a newer export updates only prices and stock, so the WooCommerce store opens with the same prices and stock levels Magento had on its last day.
The Function Editor helpers take the most effort, but you only set them up once, because they’re saved with the import along with every other Manual Setup setting. Each re-run then takes a few clicks. WP All Import imports Magento’s own product export into WooCommerce without any spreadsheet work, and the same saved import keeps those products current until the new store goes live.
If you’re planning the move, try it with your own Magento export first. WP All Import has a free sandbox site with WooCommerce already installed, so you can run the export through Automatic Setup and add the helpers before you buy.
Common Questions About Importing Magento Products into WooCommerce
How do I import a Magento CSV into WooCommerce?
You can import a Magento CSV into WooCommerce with WP All Import, and the file doesn’t need any editing first.
- In Magento, export your products from System › Data Transfer › Export, with Entity Type set to Products.
- In WordPress, go to All Import › New Import, click Set up automatically and upload the CSV.
- Choose WooCommerce › Products and click Start Automatic Setup.
- Click Manual Setup and add the Magento helper functions in the Function Editor.
- Link the variations to their parents in the Variations tab, then set up the Attributes rows.
- Run the import, then run it again to attach any variations listed above their parent.
Can WooCommerce’s built-in importer read a Magento product export?
No. WooCommerce’s built-in importer can’t read a Magento product export as Magento creates it because the two use different layouts. WooCommerce expects each variation row to name its parent in a Parent column and each attribute to have its own name and value columns. A Magento export keeps the parent link on the parent row and packs a variation’s options into one additional_attributes column, so the file needs reworking first. WP All Import imports the Magento export without that rework, using Function Editor helpers for the packed columns.
How do I keep my Magento store open while moving to WooCommerce?
To keep your Magento store open while moving to WooCommerce, import the catalog early and re-run the same import from newer Magento exports until launch day. For those re-runs, set Choose which data to update in WP All Import to the Price & Stock fields, so WooCommerce picks up Magento’s latest prices and stock without overwriting anything else. On launch day, run the import one last time, then point your domain at WooCommerce.
Will moving from Magento to WooCommerce affect SEO?
Yes. Moving from Magento to WooCommerce affects SEO because your product URLs change. Magento’s product URLs end in .html by default, while WooCommerce puts product pages under /product/, so old links would lead to missing pages. Set up 301 redirects from each Magento URL to its new WooCommerce page before you switch the domain, so search engines and shoppers still get to see the right product.
Can I import Magento customers into WooCommerce?
Yes. You can import Magento customers into WooCommerce with WP All Import. Magento exports them from the same System › Data Transfer › Export screen, with Entity Type set to Customers Main File. On WP All Import’s Choose What to Import screen, the Customers option sits next to Products.
Further Reading
Get Oxygen
Build it your way with Oxygen.
Not per year, not per site, not per seat. 60 day money back guarantee.