Import data with WP–CLI

WordPress Ultimate CSV Importer now supports WP – CLI.

Import your Data with WP – CLI(WordPress Command Line Interface), no need for a web browser. It is a powerful command line tool to run and import your data.

You can use WP – CLI to do multi-tasks in the WordPress Database. You’ll note that WP-CLI contains streamlined commands designed for WordPress sites if you’re familiar with utilizing SSH commands. WP – CLI import helps to import the data faster and avoid the timeout error.

 

For Linux/Mac Users:

To check WP – CLI installation with CSV importer, type the following command in Command Prompt.

cd /var/www/html/(wordpress root file)/wp –help

And Enter.

wordpress-help-command

Once the plugin is installed, the list will include our import plugin.

ultimate-import-listed-inside-wp-help

 

For Windows Users:

  • Install SSH Client, PuTTY
  • (PuTTY is a reasonably well-known SSH client, and installing and configuring it should be rather simple.)
  • Enter your Host Name

putty-configuration

  • Select SSH from the Radio button option
  • Click Open
  • Your username and password must be entered when requested.
  • If we establish a connection to our server, we should see if our host has pre-installed WP-CLI.
  • Check this by typing the following command into the prompt.

cd /var/www/html/(wordpress root file)/wp –help

wordpress-help-command

 

Import data with CSV/XML

You can import the data of posts/custom posts/ pages/ Users/ WooCommerce and many more. For Custom fields, create a field with the supported third-party plugin. Then create a CSV file based on that.

The import process is the same as the normal import till the Media Handling section.

Step 1 – Browse a file

Select any one of the modules from the import. We are providing four options to upload the required CSV file. Upload files from the desktop, FTP, external URL, and from the server.

(Note: If you are updating the data, select Existing Items.)

import-record-as-posts

Once the file is uploaded, select the desired option from “Import each record as”.

Step 2 – Mapping Section

In the mapping page, map the WP fields with CSV header fields.

csv-importer-posts-fields-mapping

Check all the necessary fields are mapped and click continue.

Step 3 – Media Handling

To download external images in your WP media, Featured Image Handling is used. You can configure this by enabling the ‘Download external images to your media’ button. This option is enabled by default. Feature Image handling option allows you to assign new or existing WP gallery images.

csv-importer-media-handling

 

Step 4 – WP Ultimate CSV List and Run

Open your Command Prompt.

Then log in with the User name and Password.

Using WP Ultimate CSV importer PRO

Type the following command to get the CSV file to run.

wp ultimate-import list

csv-importer-pro-record-list-in-cli

Then the list of files with the template name and ID will appear.

Type the following command to run the import with a specific template ID.

wp ultimate-import run (ID)

Ex: wp ultimate-import run 3

csv-importer-pro-import-run-in-cli

 Here, we can see the data progress details also.

Also, the log details will be displayed after the completion of the import.

csv-importer-cli-import-log

 

Using CSV importer – Free version

Type the following command to get the CSV file to run.

wp ultimate-csvimport list

csv-importer-free-uploaded-file-list-in-cli

Type the following command to run the import.

wp ultimate-csvimport run (ID)

Ex: wp ultimate-csvimport run 1,3

(Using comma separator for Multi-import)

multiple-import-via-cli-csv-importer-free

 

Using WPML

Type the following command to import the data with the WPML plugin.

wp ultimate-wpmlimport list

ultimate-csv-importer-wpml-import-list

To import with a specific template ID, type the below command

wp ultimate-wpmlimport run (ID)

Ex: wp ultimate-wpmlimport run 3

wp-ultimate-wpml-import-run-cli

 

Using WP Custom Fields

Enter the following command to get the CSV file template.

wp ultimate-cfimport list

wp-ultimate-custom-fields-import-list-cli

Mention the following command to run the import.

wp ultimate-cfimport run (ID)

Ex: wp ultimate-cfimport run 1

WP-CLI-CF-import-run

We can import multiple templates using a comma (,) separator.

Eg: wp ultimate-import run 1,2

wp-ultimate-import-run-multi-csv

 

Update data

Enable the Existing Items options to execute the update operation. Start by importing your updated CSV or XML file. Configure the Mapping and Media Handling section that follows the same update procedure. With the WP Ultimate CSV Importer plugin, update all the WordPress field data by enabling Do you want to handle the duplicate on existing records?

csv-importer-update data-via-wp-cli