PHPackages                             morrislaptop/advanced-custom-fields-wpcli - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. morrislaptop/advanced-custom-fields-wpcli

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

morrislaptop/advanced-custom-fields-wpcli
=========================================

Manage Advanced Custom Fields through WP-CLI

3.0.0(9y ago)01.9kMITGherkin

Since Nov 20Pushed 8y agoCompare

[ Source](https://github.com/morrislaptop/advanced-custom-fields-wpcli)[ Packagist](https://packagist.org/packages/morrislaptop/advanced-custom-fields-wpcli)[ RSS](/packages/morrislaptop-advanced-custom-fields-wpcli/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (24)Used By (0)

WP-CLI for Advanced Custom Fields
=================================

[](#wp-cli-for-advanced-custom-fields)

### Description

[](#description)

WP-CLI for Advanced Custom Fields helps you manage your field-groups through WP-CLI. The reason we started this project is to make life easier for developers working on Wordpress projects using the Advanced Custom Fields Pro plugin. Fields can now easily be imported, exported and shared over SVN, GIT or comparable systems.

Installation
------------

[](#installation)

### Requirements

[](#requirements)

- Advanced Custom Fields 5 Pro plugin
- `wp-cli`

### How to install

[](#how-to-install)

Install WP-CLI as described on [http://wp-cli.org/](http://wp-cli.org/ "WP-CLI")

Using composer: (doesn't work for now until we have released the plugin on wordpress.org/plugins)

```
composer require wpackagist-plugin/advanced-custom-fields-wpcli

```

By GIT clone in plugins directory:

```
git clone https://github.com/hoppinger/advanced-custom-fields-wpcli.git

```

WordPress plugin installation: Download zip and put the files in the plugins directory.

- Activate this plugin in the plugin menu or using:

```
wp plugin activate advanced-custom-fields-wpcli

```

Go the wordpress directory in your terminal and run:

```
wp acf

```

To see if everything is working correctly.

When the plugin is enabled, any exported field groups found on the filesystem in your registered paths will be added to Wordpress at runtime. If you would like to disable this behaviour you can remove the `acf_wpcli_register_groups` action:

```
remove_action('plugins_loaded', 'acf_wpcli_register_groups');

```

Commands
--------

[](#commands)

This project adds the `acf` command to `wp-cli` with the following subcommands:

### Help

[](#help)

```
wp acf

```

Prints the help overview and can be used as a default test to see if the plugin is working.

### Export

[](#export)

Export a field-group to a json file in the directory set by a [filter](#filters).

```
wp acf export

```

For testing purposes, etc. you can also define a export directory explicitly without applying the filter by using the `--export_path` parameter.

```
wp acf export --export_path=acf-exports/

```

You want to export all field-groups all at once you can use:

```
wp acf export --all

```

### Import

[](#import)

```
wp acf import

```

Import all or specific fields from a option menu,

### Clean

[](#clean)

```
wp acf clean

```

Delete all Advanced Custom Fields Records from the database. Do this after you have edited fields-groups from the UI and exported the changes. **Warning: This can not be undone, please use carefully**

Filters
-------

[](#filters)

### acfwpcli\_fieldgroup\_paths

[](#acfwpcli_fieldgroup_paths)

The acfwpcli\_fieldgroup\_paths gives you the ability to add more paths where ACF-CLI should load/export from/to. You should **always add at least one path** to this filter.

```
add_filter( 'acfwpcli_fieldgroup_paths', 'add_plugin_path' );

public function add_plugin_path( $paths ) {
  $paths['my_plugin'] = MY_PLUGIN_ROOT . '/lib/field-groups/';
  return $paths;
}

```

Unit testing
------------

[](#unit-testing)

To test changes to the plugin you can use unit testing. Start by making sure all the necessary dependencies are installed, if not run:

```
composer install

```

You will need a new Wordpress installation to make sure the tests run independent from your Wordpress installation and database. To create a wordpress installation for testing run the following command:

```
bash bin/test_wp_install.sh wordpress_test db_username db_password localhost latest

```

Where 'wordpress\_test' is the name for the database used to run the tests. Make sure this database doesn't exist or can be deleted. When the database already exists the script will ask you if the database can be deleted. 'Latest' can be changed if you want to test with a specific version of Wordpress, 3.6.2 for example.

After you installed you can start running tests using the follow command:

```
vendor/bin/behat

```

This will run all test. These tests include an import and export of all types of fields, cleaning, multiple fields in one field-group and tests for the menu options. If you want to run one specific test you can do this by running:

```
vendor/bin/behat features/testname.feature

```

If you need a different test you can create your own by added it to the features in the features folder.

Upgrade Notice
--------------

[](#upgrade-notice)

### 3.0

[](#30)

- Make sure you import all your custom fields before updating.
- Make sure you are you using ACF5, ACF4 is not supported.
- Update the plugin
- Add the filter to your project (see [Filters](#filters))
- Export you fields
- Remove unnecessary files like your old import directory, php files and json files.

Changelog
---------

[](#changelog)

### 3.0

[](#30-1)

- Bugfix: Import no longer created duplicates
- Add unit testing with behat and PHPUnit

### 2.0

[](#20)

- Removed uniqid feature (no longer needed).
- Bugfix: database fieldgroups are now prefered over exported fieldgroups.
- Cleaned up legacy xml import/export libraries.
- Add namespaces.
- Cleaned up all alternative notation uses.
- Multisite now correctly makes use of the global --url parameter.
- Added more comments and versioning.
- Removed dependency of wp-importer.
- Added support for composer installs.
- Dropped XML support, hello Json.

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 55% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~149 days

Recently: every ~186 days

Total

6

Last Release

3447d ago

Major Versions

1.2.1 → 2.0.02015-12-22

v1.2.x-dev → 3.0.02016-12-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/ecf933ed5c8b3e08c1880734166cb32d9e66eb50b01bb91ff74018c3e4b61058?d=identicon)[morrislaptop](/maintainers/morrislaptop)

---

Top Contributors

[![sebastiaandegeus](https://avatars.githubusercontent.com/u/1560127?v=4)](https://github.com/sebastiaandegeus "sebastiaandegeus (127 commits)")[![marceldillen](https://avatars.githubusercontent.com/u/521326?v=4)](https://github.com/marceldillen "marceldillen (54 commits)")[![robert388](https://avatars.githubusercontent.com/u/1241906?v=4)](https://github.com/robert388 "robert388 (19 commits)")[![FrankLadage](https://avatars.githubusercontent.com/u/8735868?v=4)](https://github.com/FrankLadage "FrankLadage (8 commits)")[![jmslbam](https://avatars.githubusercontent.com/u/145887?v=4)](https://github.com/jmslbam "jmslbam (5 commits)")[![paulhuisman](https://avatars.githubusercontent.com/u/37524?v=4)](https://github.com/paulhuisman "paulhuisman (4 commits)")[![thisislawatts](https://avatars.githubusercontent.com/u/472589?v=4)](https://github.com/thisislawatts "thisislawatts (4 commits)")[![audionerd](https://avatars.githubusercontent.com/u/23459?v=4)](https://github.com/audionerd "audionerd (2 commits)")[![timhuisman](https://avatars.githubusercontent.com/u/2250980?v=4)](https://github.com/timhuisman "timhuisman (1 commits)")[![averaart](https://avatars.githubusercontent.com/u/1152495?v=4)](https://github.com/averaart "averaart (1 commits)")[![cies](https://avatars.githubusercontent.com/u/8694?v=4)](https://github.com/cies "cies (1 commits)")[![elvismdev](https://avatars.githubusercontent.com/u/3847077?v=4)](https://github.com/elvismdev "elvismdev (1 commits)")[![korstiaan](https://avatars.githubusercontent.com/u/902842?v=4)](https://github.com/korstiaan "korstiaan (1 commits)")[![lsmith77](https://avatars.githubusercontent.com/u/300279?v=4)](https://github.com/lsmith77 "lsmith77 (1 commits)")[![morrislaptop](https://avatars.githubusercontent.com/u/67807?v=4)](https://github.com/morrislaptop "morrislaptop (1 commits)")[![ashfame](https://avatars.githubusercontent.com/u/858906?v=4)](https://github.com/ashfame "ashfame (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/morrislaptop-advanced-custom-fields-wpcli/health.svg)

```
[![Health](https://phpackages.com/badges/morrislaptop-advanced-custom-fields-wpcli/health.svg)](https://phpackages.com/packages/morrislaptop-advanced-custom-fields-wpcli)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
