ACF
The acf command group lets you version-control Advanced Custom Fields configuration as plain JSON files in Git: field groups, post types, taxonomies, and options pages.
Requires ACF to be installed and active on the WordPress site, either ACF PRO or the free Secure Custom Fields fork. Options pages must be registered with acf_add_options_page() for pull/push to see them.
Typical workflow
Section titled “Typical workflow”# 1. Download existing ACF configuration from WordPresslps acf pull
# 2. Edit locally, commit to Gitgit add acf/ && git commit -m "feat: add pricing field group"
# 3. Deploy back to WordPresslps acf pushCommands
Section titled “Commands”lps acf pull
Section titled “lps acf pull”Download ACF field groups, post types, taxonomies, and options pages from WordPress and write them as .json files, one per object.
lps acf pull [path]| Argument | Default | Description |
|---|---|---|
path |
./acf (or loopress.json’s acfDir) |
Local directory where ACF configuration is written |
| Flag | Description |
|---|---|
--type |
Limit to specific object types: field-groups, post-types, taxonomies, options-pages. Repeatable. |
--dry-run / -d |
Show what would be written without touching the filesystem |
Local files with a key no longer present on WordPress are removed on pull, so the directory always mirrors the site. In a terminal the files are listed and a confirmation is asked first (--yes skips it); in scripts and CI they are removed and reported.
Example:
lps acf pull --type field-groups --dry-runlps acf push
Section titled “lps acf push”Upload .json files from a local directory to WordPress. Each object is identified by its own stable key, so push always resolves to create-or-update on that object, there’s no id/slug matching step like snippets.
Active content is stripped from every string in the imported object (field labels, instructions, choices, a Message field’s content) before it is stored: those are rendered in the block editor for every user who opens a post using the group, so a <script> or onerror= handler pushed there would otherwise run in an admin session. Benign HTML and plain text are left byte-for-byte unchanged.
lps acf push [path]| Argument | Default | Description |
|---|---|---|
path |
./acf (or loopress.json’s acfDir) |
Local directory to read .json files from |
| Flag | Description |
|---|---|
--type |
Limit to specific object types: field-groups, post-types, taxonomies, options-pages. Repeatable. |
--dry-run / -d |
Show what would be pushed without making any changes |
Example:
lps acf push ./acflps acf list
Section titled “lps acf list”Print all ACF objects currently on WordPress, grouped by type.
lps acf list| Flag | Description |
|---|---|
--type |
Limit to specific object types: field-groups, post-types, taxonomies, options-pages. Repeatable. |
--json |
Output raw JSON instead of formatted text |
Example output:
field-groups (2): group_pricing. Pricing Fields group_homepage. Homepage Fields
options-pages (0): (none)File format
Section titled “File format”Each ACF object is stored as one file, named {key}.json, in a subdirectory per type:
acf/ field-groups/ group_pricing.json group_homepage.json post-types/ post_type_testimonial.json taxonomies/ options-pages/Files round-trip ACF’s own export format untouched, the CLI only reads the key field to name the file and identify the object on push.