跳转到主要内容

WP-CLI Commands

All available WP-CLI commands for ACF and ACF PRO, with links to documentation for usage and subcommands.

Commands

Command Subcommand Description
wp acf json Manages ACF JSON import, export, and synchronization
status Shows the sync status for ACF items
sync Syncs local JSON changes to the database
import Imports items from a JSON file
export Exports items to a JSON file

Global Parameters

These parameters are available for all wp acf subcommands:

--path=<path> : Path to the WordPress installation.

--url=<url> : Target site URL (for multisite).

--user=<user> : Set the WordPress user for the command.

Examples

# Show sync status for all ACF items
wp acf json status

# Sync all pending local JSON changes to database
wp acf json sync

# Export field groups to JSON files
wp acf json export --type=field-group

Requirements

  • ACF 6.8 or later
  • WP-CLI 2.0 or later