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 🙂
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.