ACF Field Groups
import { Aside } from â@astrojs/starlight/componentsâ;
The acf command group lets you version-control Advanced Custom Fields field group definitions. Each field group is stored as a .json file that you commit to Git and deploy across environments.
Requirements
Section titled âRequirementsâ- Loopress plugin installed and active on the WordPress site
- Advanced Custom Fields (free or Pro) installed and active
- Administrator credentials configured via
lps site config
Commands
Section titled âCommandsâlps acf pull
Section titled âlps acf pullâDownload all ACF field groups from WordPress and write them as JSON files.
lps acf pull [path]| Argument | Default | Description |
|---|---|---|
path | ./acf | Directory where field group files are written |
| Flag | Description |
|---|---|
--dryRun / -d | Show what would be written without touching the filesystem |
Each field group is saved as <group-key>.json (e.g. group_64abc123.json). The file contains the full field group definition including all nested fields.
Example:
lps acf pulllps acf pull ./acf-groups --dryRunlps acf push
Section titled âlps acf pushâUpload field group JSON files to WordPress. If a group with the same key already exists it is updated; otherwise a new group is created.
lps acf push [path]| Argument | Default | Description |
|---|---|---|
path | ./acf | Directory containing *.json field group files |
| Flag | Description |
|---|---|
--dryRun / -d | Show what would be pushed without making any changes |
Example:
lps acf pushlps acf push ./acf-groupsTypical workflow
Section titled âTypical workflowâ# 1. Export field groups from the development sitelps site switch # select developmentlps acf pull
# 2. Commit to Gitgit add acf/ && git commit -m "feat: add product fields group"
# 3. Deploy to staging / productionlps site switch # select staginglps acf pushFile format
Section titled âFile formatâacf/ group_64abc123.json â one file per field group group_64def456.jsonEach file is standard ACF export JSON, identical to what you would get from ACFâs own Tools â Export screen. You can round-trip files between Loopress and the ACF UI without any conversion.