WP-CLI
You can run an import using WP All Import's WP-CLI integration. Imports run with WP-CLI tend to process about 50% faster than those run through the WordPress admin panel.
WP-CLI is only supported for WP All Import at the moment. Some import add-ons are still not supported.
You can list the imports to find the ID you want to run:
$ wp all-import list
To run an import, you just need to specify the import ID:
$ wp all-import run <import id>
If you prefer to run several imports in sequence, a comma-delimited list of import IDs can be specified:
$ wp all-import run <import id>,<import id>,<import id>
While imports can be run with WP-CLI, you still need to create and edit them in the WordPress admin panel. After saving your import, you can see the import ID on the Manage Imports page, or you can use the list command above.
Options
<import_id>
A single import ID or comma-delimited list of IDs to run.
$ wp all-import run 1
$ wp all-import run 1,2,3
[--force-run]
A flag to force the import to run even if it's already triggered.
$ wp all-import run 1 --force-run
[--disable-log]
A flag to disable the import history log for this run.
$ wp all-import run 1 --disable-log
Import Any CSV, XML, or Excel to WordPress
- Any theme or plugin
- Images & galleries
- Custom fields
- Categories & tags
- Woo, ACF, Meta Box, JetEngine
Global Parameters
WP-CLI has a series of global parameters that you can use with all commands. For example, you can specify the path to your WordPress installation files with the [--path] flag.
[--path=<path>]
Path to the WordPress files.
$ wp --path=http://example.com/site/ all-import run 1
[--url=<url>]
Pretend request came from given URL. In multisite, this argument is how the target site is specified.
$ wp --url=http://example.com/subsite3/ all-import run 1
You can learn more about all global parameters available here: Global parameters for WP-CLI.
Add-On Compatibility
In order to be run with WP-CLI, import add-ons must be written using a singleton, a class limited to a single instance. You can read more about this here: https://www.wpallimport.com/documentation/best-practices/.
For your reference, here's a list of the add-ons we released that are currently compatible with WP-CLI importing:
- Import Listings into the Listify Theme
- Import Listings into WP Job Manager
- Import Property Listings into WP Residence
- Import Settings into All In One SEO
- Import Settings into WordPress SEO Plugin – Rank Math
- Import Products from any XML or CSV to WooCommerce
Related Docs
This guide contains everything we know about speeding up imports.
Use our optional/paid Automatic Scheduling Service to run your imports.
Learn how to use WP All Import to import any file into WordPress.