Sync ACF fields across sites on WP multisite

Since you are using ACF Pro you could make use of the "Export/Import" feature.

  1. Network Activate Advanced Custom Fields
  2. Create Field Groups on the Main Site through the Custom Fields Menu.
  3. Use Custom Fields –> Export, select all field groups, Export to PHP
  4. Paste the PHP into your (child) theme’s functions.php
  5. Go back and trash the fields from the main site so there aren’t duplicates.

You now have ACF fields available network-wide.


I was thinking about this same thing couple of times before and came to conclusion that easiest thing would be to create a github repo with set of acf-field-name.php files and then bring those repos as submodules to each of your projects. If you place this php files in acf folder within your theme folder and use function within functions.php like this

    function getAcfFileNames()
    {
        return array(
            'acf-one',
            'acf-two',
            'acf-three',
        );
    }

    function add_php_acf_field_groups()
    {
        $fileNames = getAcfFileNames();
        foreach ($fileNames as $fileName) {
            include_once 'acf/' . $fileName . '.php';
        }
    }

    ;
    add_action('acf/init', 'add_php_acf_field_groups');

That should work just fine. And if you want to edit those acf.php files within project you can use -> https://github.com/BeAPI/ACF-PHP-Recovery to recover php file locally and update it. After that just export the file and commit it to your ACF repo.

Other then that unfortunately I haven't found better solution.