Getting Started

Using the Export CLI Command in Super Speedy Imports

Published · Last updated

Super Speedy Imports includes a wp ssi export command that writes the posts of any post type to a CSV file. The command is part of the paid edition.

Use it to:

  • Create backups of your WordPress content
  • Move content between WordPress installations
  • Analyse your content in a spreadsheet
  • Edit data in bulk and import it back

The command has two forms. The re-importable form is the one to use for backups, migrations and bulk edits. The diagnostic form exists for comparing raw database contents.

Re-importable export

wp ssi export <post_type> [output_file]
  • <post_type> (required): the post type to export, for example product or post. A trailing “s” is accepted, so products also works.
  • [output_file] (optional): where to write the CSV. Without it, the file is written to wp-content/uploads/super-speedy-imports/exports/ with a randomly generated name, and the command prints the full path.

For example:

wp ssi export product
wp ssi export product ./exports/products.csv

This is the same export as the plugin’s Export tab. It leaves out values that WordPress or WooCommerce calculate for themselves, so the file imports cleanly into another site. When you create a new import from a CSV exported by Super Speedy Imports, the import recognises the file and configures its mappings automatically.

Text values that a spreadsheet would run as a formula (starting with =, +, -, @, a tab or a carriage return) get a leading apostrophe, the spreadsheet convention for “treat as text”. Numbers such as -5 are left alone, and the import strips the apostrophe again.

Note

An export contains every field and all the metadata of every exported post, which can include private data. The default folder carries deny rules for Apache, and the random file name stops anyone guessing the URL on any web server. Delete the file when you’ve finished with it.

Diagnostic export

wp ssi export <output_file> <post_type> [--exclude-dates] [--include-lookup]

The command uses this form when the first argument is a file path rather than a post type name. For example:

wp ssi export ./exports/products.csv product --exclude-dates

It produces a fixed-shape file for comparing two sites or two runs. --exclude-dates leaves out the date columns so two exports taken at different times compare cleanly, and --include-lookup adds WooCommerce’s product lookup table columns. Use the re-importable form when you intend to import the file.

What an export contains

  • All standard WordPress post fields
  • Post metadata (custom fields)
  • The taxonomy terms assigned to each post
  • Featured image URLs
  • Gallery image URLs
  • Parent SKUs, for variable products and other hierarchical post types

Troubleshooting

If the command reports an error:

  1. Make sure you can write to the output directory.
  2. Check that the post type exists on this site (wp post-type list).
  3. For very large exports, raise the PHP memory limit for WP-CLI.
  4. If the command says CSV export is disabled, turn it on under Settings > Beta features.

A failed re-importable export prints the database error rather than leaving a silently empty file.

Further reading

every wp ssi command and flag.
how an import configures itself from an exported CSV.

Written for Super Speedy Imports 2.99.19.

Comments

▲
▼
1/1