PHPackages                             stoutlogic/acf-migrations - 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. stoutlogic/acf-migrations

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

stoutlogic/acf-migrations
=========================

Make field name and key changes to ACF fields, without losing content.

62982[2 issues](https://github.com/StoutLogic/acf-migrations/issues)PHP

Since May 15Pushed 4y ago9 watchersCompare

[ Source](https://github.com/StoutLogic/acf-migrations)[ Packagist](https://packagist.org/packages/stoutlogic/acf-migrations)[ RSS](/packages/stoutlogic-acf-migrations/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

ACF Migrations
==============

[](#acf-migrations)

[![Build Status](https://camo.githubusercontent.com/c8fdb9cbf4b5128893683e65d2dc806e0c4e0960390b10a2b0b8e4e100b3ffc9/68747470733a2f2f7472617669732d63692e6f72672f53746f75744c6f6769632f6163662d6d6967726174696f6e732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/StoutLogic/acf-migrations)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a7791f6d10cbfa0f48ee88a599b37bd1317ddf6f6f961109539f1e0ae58cc911/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f53746f75744c6f6769632f6163662d6d6967726174696f6e732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/StoutLogic/acf-migrations/?branch=master)

***Warning: Not for production use yet.***

Allow yourself to refactor [Advanced Custom Fields](https://www.advancedcustomfields.com/) field names and field keys without losing content in existing fields.

Don't you hate when you rename a field you lose all associated content with that field? It really hurts any refactoring efforts, and really forces you to get it right the first time.

The ACF Migrations library gives you tools to change field names and keys, and then update the database for you.

The ACF Migrations code you write can exist inside a single use script, or a custom theme or plugin upgrade script you maintain or even inside full blown migration library (to come).

**NOTE:** This does not change the name of the field inside ACF. That is either done via the UI, in the json file or in your own PHP code. After (or before) that, migrate your existing content to use the new field name and or field key.

### Simple Example

[](#simple-example)

A custom `location` post type has a `zip_code` field. Due to expansion outside of the US and into Canada, we want to rename the field to be `postal_code`. Of course we can just change the label on the field to reflect this change to the admin user, we also want to change it in our code so that there is no confusion amoung developers.

The field's name is `zip_code` and the key is `field_zip_code`. And we want to change the name to `postal_code` and the key to `field_postal_code`.

```
$migrateField = new FieldMigration('field_zip_code');
$migrateField
    ->changeName('postal_code')
    ->changeKey('field_postal_code')
    ->migrate();
```

Once `migrate` is called, all instances of meta data with the field key 'field\_zip\_code' on Posts, Terms, Users, Comments and Options Pages will be changed.

Install
-------

[](#install)

Use composer to install into your composer based WordPress theme or plugin:

```
composer require stoutlogic/acf-migrations

```

Tests
-----

[](#tests)

To run the tests you can manually run. The integration tests will require local configuration. Instructions to come.

```
composer run tests

```

Requirements
------------

[](#requirements)

PHP 5.6 and later are supported.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3af49c3062ca45af5b35db4f85e4aad28762b4034061020cca9df44d11a9914d?d=identicon)[stoutlogic](/maintainers/stoutlogic)

---

Top Contributors

[![stevep](https://avatars.githubusercontent.com/u/9717?v=4)](https://github.com/stevep "stevep (22 commits)")

### Embed Badge

![Health badge](/badges/stoutlogic-acf-migrations/health.svg)

```
[![Health](https://phpackages.com/badges/stoutlogic-acf-migrations/health.svg)](https://phpackages.com/packages/stoutlogic-acf-migrations)
```

###  Alternatives

[outerweb/filament-settings

Filament integration for the outerweb/settings package

3690.9k4](/packages/outerweb-filament-settings)[leeovery/wordpress-to-laravel

1142.4k](/packages/leeovery-wordpress-to-laravel)

PHPackages © 2026

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