WP All Import

How to use WP All Import

First, get a csv file that contains all the posts (or products) of your previous site (eg. OpenCart, Joomla, Drupal etc.). So find an appropriate plugin, install it and export the csv file.

For products, you will usually want to transfer the fields below:

  • Title
  • Description
  • SKU
  • Price
  • Featured image
  • Category name (or categories with a parent/child relationship)
  • Brand name

If your products have hierarchical (parent/child) categories, then in your category csv field, you should have this format:

Sports > Golf > Clubs > Putters

Now, process the csv file, in order to be compatible with WP All Import.

One rule, is that each row should have a column that has unique values (eg. the SKU code of a product).

In OpenOffice, by using CTRL+F, you can use regular expressions in order to delete unwanted sections (eg. shortcodes). Make sure you click more options and tick Current selection only and Regular expressions. Here are some useful expressions.

Search for Replace with Result
\[myshortcode.*myshortcode\]  space  Remove shortcodes
[:space:]+  @@ 1st step to remove multiple spaces
@@ space 2nd step to remove multiple spaces
\.\B space Remove last dot

In MySQL, you can fix possible errors, in the product’s content text with the replace function. For example, to fix possible image url errors, you can use:

update wp_posts set post_content = replace(post_content,'http://www.mywebsite.com/image/http://www.mywebsite.com','http://www.mywebsite.com');

In order to remove non-breaking spaces you can use:

update wp_posts set post_content = replace(post_content,'&nbsp;', '<p></p>');

How to use WP All Import with Google Spreadsheets

Step 1: Publish your spreadsheet to csv

To do so:

  1. Open your google spreadsheet
  2. From the menu, press File > Publish to the web
  3. At the pop-up, below link, select the table you want to add
  4. Right next to it (at the Web Page dropdown), select Comma Separated Values
  5. Press publish
  6. Copy the url

Step 2: Import to WP All Import

To do so:

  1. Go to All Import > New import.
  2. Press Download from URL, paste the CSV url from step 1.6 and press download
  3. Select Existing items and choose WooCommerce Products from the dropdown
  4. Press Continue to Step 2
  5. Add Filtering Options if you want (eg. price greater than zero).
  6. Press Continue to Step 3
  7. Drag from the right section the values you want to grab from the csv and drop them to the correct field on the left
  8. Save settings as a template
  9. Press Continue to Step 4
  10. Drag and drop the sku value to the _sku field
  11. Warning! On the Update existing posts with changed data in your file tick the Choose which data to update. Otherwise, it will erase the existing values.

How to use WP All Import with WPML

If you have a multilingual store, then you probably have the WPML plugin installed. Download and install WPML All Import plugin. This is the bridge between WPML and WP All Import.

You can find more details about this plugin to the official documentation page.

Let’s say that you have eg. 2 languages, English (default) and Greek. Here are the steps:

  1. Create your 2 csv files. One csv per language.
  2. Go to All Import > New import.
  3. Press Upload a file and choose your english csv.
  4. Select WooCommerce Products and press Continue to step 2
  5. On step 3, on the WPML Add-on tab, make sure that you select the English (default) language. Also, on the Automatic Record Matching to Translate, select Import data in main language (English).
  6. Finish the steps, and let the plugin import your english products.
  7. Now for the other language, repeat steps 2 to 4.
  8. On step 3, on the WPML Add-on tab, make sure that you select the other language (Greek).  Also, on the Automatic Record Matching to Translate, select Define parent import, select the english CSV and set the unique key (in my case it was the SKU column, common in both language.
  9. Finish the steps, and let the plugin import your greek product translations.

How to activate WP All Import for users with not administrator privileges (eg. for a shop manager)

  1. Download and activate Capability Manager Enhanced.
  2. Go to Users / Role capabilities.
  3. Select Shop manager and press load.
  4. Tick the manage options checkbox and press Save changes.

How to export the csv file using MySQL

Open your MySQL database using PHPMyAdmin and use something like that:

SELECT *
FROM `products_table`
WHERE `language_id` = 4
ORDER BY `product_id` ASC
INTO OUTFILE 'C:/products.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'

Post A Comment

Anti-Spam Quiz: