How to install the free version of Advanced Custom Fields with Composer

As of October 22, 2024, ACF now supports installing ACF and ACF Pro via Composer. This blog post remains up for historical reasons.

On Saturday, October 12, Matt Mullenweg usurped the popular Advanced Custom Fields plugin on the WordPress.org plugin repository and rebranded it as “Secure Custom Fields” while retaining the original plugin. I’ve written at length about why he shouldn’t have done that and the broader consequences of that action.

This post is devoted to a far more prosaic question: how do I, as a person using Composer to bundle a WordPress deployment, install the free version of Advanced Custom Fields?

Normally, the easiest way to do this would be using the WordPress Packagist mirror, but because of the usurpation of the plugin it’s no longer a reliable source:

  • "wpackagist-plugin/advanced-custom-fields":"6.3.6.1": last version of WP Engine-developed ACF
  • "wpackagist-plugin/advanced-custom-fields":"6.3.6.2": first version of “Secure Custom Fields”

Advanced Custom Fields hosting version 6.3.8 on their website and they’ve made a post explaining the situation. This version sets up ACF, not WordPress.org, as the source of further updates. For the moment, the manual download link (https://www.advancedcustomfields.com/latest/) isn’t versioned. Hopefully that’ll change going forward. The entire situation is changing rapidly. Given that link, you can use Composer’s Package repository type to wrap metadata around the download. Working example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
"repositories": [
{
"type": "package",
"package": {
"name": "wpengine/advanced-custom-fields",
"version": "6.3.8",
"dist": {
"url": "https://www.advancedcustomfields.com/latest/",
"type": "zip"
},
"extra": {
"installer-name": "advanced-custom-fields"
},
"require": {
"composer/installers": "~1.0 || ~2.0"
},
"type": "wordpress-plugin"
}
}
],
"config": {
"allow-plugins": {
"composer/installers": true
}
},
"require": {
"wpengine/advanced-custom-fields": "6.3.8",
"composer/installers": "^2.3"
},
"extra": {
"installer-paths": {
"public/wp-content/plugins/{$name}": ["type:wordpress-plugin"]
}
}
}

Let me reemphasize that this solution is fragile. I expect the ACF download link to change in the next few weeks, if not sooner. You’ll want to monitor whether that link is still providing version 6.3.8. For longer term solutions, you may want to consider running a local Satis server, or pursuing some other manual solution. If you need to have a working deployment stack right now, this option should work for you.