Skip to content

4. WP CLI Commands

James Macon edited this page Mar 20, 2023 · 10 revisions

WP-OTIS has several useful WP-CLI commands. Commands that import "all" OTIS data are respectful of any filters applied by the theme.

import

wp otis import <command> [--parameter:all]

Command Description
pois Imports full OTIS data, including all POIs (including regions and cities) and supporting information (terms)
poi Imports a single POI. Requires param --uuid (see example below)
terms Imports terms as Wordpress taxonomies
regions Imports all region POIs
cities Imports all city POIs
pois-only Imports POI informational data, but not history data (useful for troubleshooting some potential issues in wp otis report)
history-only Imports history data, but not POI informational data (useful for troubleshooting some potential issues in wp otis report)
Parameter Description
all Set by default on most commands, except "poi", which requires uuid instead
uuid Only used when importing a single POI
modified Imports all POIs with changes made after the specified date in OTIS. This function is used by the hourly CRON imports to pass a global server variable timestamped to the beginning of the previous hourly import.

Basic example, and the command to run for an initial import:

This will import all taxonomies and POIs.

wp otis import pois

With --modified flag:

This will only import POIs that have been modified since the date provided.

wp otis import pois --modified="2020-08-07"

A specific POI:

wp otis import poi --uuid=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

nobulk

Manually deactivates the bulk importer. If a large import is interrupted for some reason, the "bulk" flag can stay active on the server (visible in the CMS on the import log page). Use this command to turn the "bulk" flag off, and re-start hourly cron imports.

wp otis nobulk

report

Provides a report on data health, including troubleshooting info if any POIs are present in WordPress that do not exist in OTIS, or vice-versa. Also identifies duplicate content if any is present.

wp otis report