Skip to content

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.

  • 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

Download all ACF field groups from WordPress and write them as JSON files.

Terminal window
lps acf pull [path]
ArgumentDefaultDescription
path./acfDirectory where field group files are written
FlagDescription
--dryRun / -dShow 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:

Terminal window
lps acf pull
lps acf pull ./acf-groups --dryRun

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.

Terminal window
lps acf push [path]
ArgumentDefaultDescription
path./acfDirectory containing *.json field group files
FlagDescription
--dryRun / -dShow what would be pushed without making any changes

Example:

Terminal window
lps acf push
lps acf push ./acf-groups
Terminal window
# 1. Export field groups from the development site
lps site switch # select development
lps acf pull
# 2. Commit to Git
git add acf/ && git commit -m "feat: add product fields group"
# 3. Deploy to staging / production
lps site switch # select staging
lps acf push
acf/
group_64abc123.json ← one file per field group
group_64def456.json

Each 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.