Phil Kurth

WordPress developer, consultant, nerd

How to set your ACF Pro license key via WP CLI

I don't know about you, but I'm sick of manually setting up this key when I update a local environment or kick off a new install. So, after finally digging into WP CLI as a possible config path, I have this very quick tip for setting your ACF Pro license key using WP CLI:

wp eval 'acf_pro_update_license("PUT_YOUR_KEY_HERE");'

Throw that into a shell script that you can run after pulling a production DB to your local dev environment or as part of a provisioning process for a new install and you'll never have to manually set this again.

This will be a good solution until ACF adds a config constant for setting license keys.