Importing and exporting products in bulk using CSV
Do you want to adjust a hundred prices at once, add a new collection or transfer products from another shop system? Then you don't work product by product, but with the built-in CSV export and import of WooCommerce. That's fast, but one faulty file can also change hundreds of products with a single click. Here's how to do it safely and where things usually go wrong.
Where do you find it?
In the WordPress admin, go to Products > All products. At the top are the buttons Export and Import. A CSV file is a text file with one line per product and columns separated by commas. You open and edit it in a spreadsheet program.
The three pitfalls: character set, separator and decimal point
| Pitfall | What goes wrong | What to do |
|---|---|---|
| Character set | WooCommerce expects UTF-8. If your spreadsheet program opens or saves the file in a different character set, "é" becomes something like "é". | Explicitly choose UTF-8 when opening and saving. |
| Separator | WooCommerce reads the comma as the separator between columns. With Dutch settings, a spreadsheet program often saves with semicolons instead. | Save with commas as the separator. If a value contains a comma, it must be enclosed in double quotation marks. |
| Decimal point | WooCommerce expects a period in prices: 24.99. A price like 24,99 can be read incorrectly. | Check the price columns before importing. |
The most reliable check: open the saved file in a plain text editor, such as Notepad or TextEdit. Then you see exactly which separators and decimal points are used, and whether letters with accents are correct.
Updating existing products
- When importing, choose Update existing products. WooCommerce then looks up the product by ID or SKU. So make sure every SKU is unique and spelled correctly.
- Without that option, the import creates new products. If a SKU already exists, this causes an error and the line is skipped.
- An empty cell can mean that a value gets cleared. It's better to leave out columns you don't want to change from the file entirely. If you only want to adjust the stock, a file with the columns ID (or SKU) and Stock is enough.
- Each variation is its own line, with a reference to the main product.
Working safely in five steps
- Make a backup, or work in a test shop first. With WebOké, you can make an extra backup in WebOké Backups right before the import; see WebOké Backups: viewing, restoring or downloading a backup.
- Export everything first. Then you have the current state as a file.
- Test with one line. Create a file with one product, import it and check that product in the admin and in a private window on the site.
- Then apply the whole file. Don't refresh or leave the page while the import is running.
- Read the result. Skipped or failed lines are shown in the summary afterwards.
Upload too large or a time-out?
A large file can hit the upload limit or the time limit of PHP. You might then see 413 Request Entity Too Large, a message about upload_max_filesize, or the import gets stuck. What you can do:
- Split the file into smaller parts. This also makes errors easier to find.
- If needed, increase
upload_max_filesize,post_max_sizeandmax_execution_timein the PHP settings of your package. See Upload too large (error 413) or time-out and Upload not working: increasing upload_max_filesize and max_execution_time. - If uploading via the browser doesn't work, place the file in the
wp-content/uploadsfolder using File Manager or FTP, and enter the path on the server under the advanced options when importing.
Further reading
- Product CSV Importer and Exporter (WooCommerce, with the list of all columns, in English)
- Free WordPress course, lesson 8.1 Backups: what, where and how often
