WP-CLI Command: wp pods-api

This is the command for interacting with Pod configurations, settings, and components.

See the new Pods Admin commands for more comprehensive CLI capabilities for managing configurations.

See pods_api() for more information about the various methods themselves.

Add a pod

$ wp pods-api add-pod --name=book
Pod added.
ID: 125

$ wp pods-api add-pod --name=book --type=post_type
Pod added.
New ID: 125

$ wp pods-api add-pod --name=book --type=post_type --label=Books --singular_label=Book
Pod added.
New ID: 125

$ wp pods-api add-pod --name=genre --type=taxonomy --label=Genres --singular_label=Genre
Pod added.
New ID: 125

Save a pod

$ wp pods-api save-pod --name=book --type=post_type
Pod saved.
ID: 125

$ wp pods-api save-pod --name=book --type=post_type --label=Books --singular_label=Book
Pod saved.
ID: 125

$ wp pods-api save-pod --name=genre --type=taxonomy --label=Genres --singular_label=Genre
Pod saved.
ID: 125

Duplicate a pod

$ wp pods-api duplicate-pod --name=book
Pod duplicated.
New ID: 125

$ wp pods-api duplicate-pod --name=book --new_name=book2
Pod duplicated.
New ID: 125

$ wp pods-api duplicate-pod --name=book --new_name=book2 --label="Books Two" --singular_label="Book Two"
Pod duplicated.
New ID: 125

Reset a pod which will delete all pod items

$ wp pods-api reset-pod --name=book
Pod content reset.

Delete a pod, which will NOT delete all pod items by default

$ wp pods-api delete-pod --name=book
Pod deleted.

$ wp pods-api delete-pod --name=book --delete_all
Pod deleted.

Activate a component

$ wp pods-api activate-component --component=templates
Component activated.

Deactivate a component

$ wp pods-api deactivate-component --component=templates
Component deactivated.

Export a Pods Package to a file

$ wp pods-api export-pod --file="pods-package.json"
Pods Package exported: /your/wp/path/pods-package.json

$ wp pods-api export-pod --file="pods-package.json" --pods="book,genre"
Pods Package exported: /your/wp/path/pods-package.json

$ wp pods-api export-pod --file="/path/to/pods-package.json" --pods="book,genre"
Pods Package exported: /path/to/pods-package.json

$ wp pods-api export-pod --templates="book-single,book-list" --file="pods-package.json"
Pods Package exported: /your/wp/path/pods-package.json

$ wp pods-api export-pod --pod-pages="books,books/*" --file="pods-package.json"
Pods Package exported: /your/wp/path/pods-package.json

$ wp pods-api export-pod --pods="book,genre" --templates="book-single,book-list" --pod-pages="books,books/*" --file="pods-package.json"
Pods Package exported: /your/wp/path/pods-package.json

Import a Pods Package from a file

$ wp pods-api import-pod --file="pods-package.json"
Pods Package imported.

$ wp pods-api import-pod --file="/path/to/pods-package.json"
Pods Package imported.

$ wp pods-api import-pod --file="pods-package.json" --replace
Pods Package imported.

Clear the Pods cache

$ wp pods-api clear-cache
Pods cache cleared.

Other Helpful Documentation on Pods WP-CLI Commands

WP-CLI Command: wp pods

The command for interacting with Pod items and content

WP-CLI Command: wp pods field

This is the Pods Admin command for managing Field configurations.

WP-CLI Command: wp pods group

This is the Pods Admin command for managing Group configurations.

WP-CLI Command: wp pods pod

This is the Pods Admin command for managing Pod configurations.