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.

Got a project? Let's talk.

From website design & SEO through to custom WordPress plugin development. I transform ideas into dynamic, engaging, and high-performing solutions.
Subscribe to get the latest insights & updates in the world of web and how it impacts your business and website.
© 2024 Phil Kurth  |  All rights reserved.