Support

Account

Home Forums Backend Issues (wp-admin) How do I get a site wide of list all ACF fields Reply To: How do I get a site wide of list all ACF fields

  • Hi @jayokey

    There are undocumented functions that you can use get all the field groups and the custom fields associated with it. Could you please try the following code?

    $groups = acf_get_field_groups();
    foreach( $groups as $group ) {
        $fields = acf_get_fields($group);
        if($fields ) {
            foreach( $fields as $field ){
                echo 'Label: ' . $field['label'];
                echo "\n";
                echo 'Name: ' . $field['name'];
                echo "\n";
                echo 'Type: ' . $field['type'];
                echo "\n";
            }
        }
    }

    I hope this helps πŸ™‚