PHPackages                             wp-graphql/wp-graphql-acf - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. wp-graphql/wp-graphql-acf

AbandonedArchivedWordpress-plugin[API Development](/categories/api)

wp-graphql/wp-graphql-acf
=========================

Advanced Custom Fields bindings for wp-graphql

v0.6.2(1y ago)621361.3k↓10.9%116[23 PRs](https://github.com/wp-graphql/wp-graphql-acf/pulls)8GPL-3.0+PHPPHP ^7.1 || ^8.0

Since May 29Pushed 1y ago22 watchersCompare

[ Source](https://github.com/wp-graphql/wp-graphql-acf)[ Packagist](https://packagist.org/packages/wp-graphql/wp-graphql-acf)[ RSS](/packages/wp-graphql-wp-graphql-acf/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (10)Dependencies (19)Versions (53)Used By (8)

WPGraphQL for Advanced Custom Fields
====================================

[](#wpgraphql-for-advanced-custom-fields)

---

🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨

This plugin has gone through a complete re-architecture and this repository will soon be archived.

We recommend you upgrade to the new WPGraphQL for ACF v2.0+ at your earliest convenience.

The new version contains breaking changes, so update with caution. Below are some resources to help:

- UPGRADE GUIDE:
- NEW PLUGIN REPO:
- NEW PLUGIN ON WORDPRESS.ORG:
- NEW PLUGIN ON COMPOSER:
- NEW PLUGIN ON WPPACKAGIST: [https://wpackagist.org/search?q=wpgraphql-acf&amp;type=any&amp;search=](https://wpackagist.org/search?q=wpgraphql-acf&type=any&search=)

🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
-------------

[](#)

WPGraphQL for Advanced Custom Fields automatically exposes your ACF fields to the WPGraphQL Schema.

- [Install and Activate](#install-and-activate)
    - [Installing from Github](#install-from-github)
    - [Installing with Composer](#install-with-composer)
- [Dependencies](#dependencies)
- [Adding Fields to the WPGraphQL Schema](#adding-fields-to-wpgraphql)
- [Supported Fields](#supported-fields)
    - [Accordion](./docs/fields/accordion.md)
    - [Button Group](./docs/fields/button-group.md)
    - [Checkbox](./docs/fields/checkbox.md)
    - [Clone](./docs/fields/clone.md)
    - [Color Picker](./docs/fields/color-picker.md)
    - [Date Picker](./docs/fields/date-picker.md)
    - [Date/Time Picker](./docs/fields/date-time-picker.md)
    - [Email](./docs/fields/email.md)
    - [File](./docs/fields/file.md)
    - [Flexible Content](./docs/fields/flexible-content.md)
    - [Gallery](./docs/fields/gallery.md)
    - [Google Map](./docs/fields/google-map.md)
    - [Group](./docs/fields/group.md)
    - [Image](./docs/fields/image.md)
    - [Link](./docs/fields/link.md)
    - [Message](./docs/fields/message.md)
    - [Number](./docs/fields/number.md)
    - [Oembed](./docs/fields/oembed.md)
    - [Page Link](./docs/fields/page-link.md)
    - [Password](./docs/fields/password.md)
    - [Post Object](./docs/fields/post-object.md)
    - [Radio](./docs/fields/radio.md)
    - [Range](./docs/fields/range.md)
    - [Relationship](./docs/fields/relationship.md)
    - [Repeater](./docs/fields/repeater.md)
    - [Select](./docs/fields/select.md)
    - [Tab](./docs/fields/tab.md)
    - [Taxonomy](./docs/fields/taxonomy.md)
    - [Text](./docs/fields/text.md)
    - [Text Area](./docs/fields/text-area.md)
    - [Time Picker](./docs/fields/time-picker.md)
    - [True/False](./docs/fields/true-false.md)
    - [Url](./docs/fields/url.md)
    - [User](./docs/fields/user.md)
    - [WYSIWYG](./docs/fields/wysiwyg.md)
- [Options Pages](#options-pages)
- [Location Rules](#location-rules)

Install and Activate
---------------------------------------------------------------------

[](#install-and-activate-)

WPGraphQL for Advanced Custom Fields is not currently available on the WordPress.org repository, so you must download it from Github, or Composer.

### Installing From Github

[](#installing-from-github-)

To install the plugin from Github, you can [download the latest release zip file](https://github.com/wp-graphql/wp-graphql-acf/archive/master.zip), upload the Zip file to your WordPress install, and activate the plugin.

[Click here](https://wordpress.org/support/article/managing-plugins/) to learn more about installing WordPress plugins from a Zip file.

### Installing from Composer

[](#installing-from-composer-)

`composer require wp-graphql/wp-graphql-acf`

Dependencies
-----------------------------------------------------

[](#dependencies-)

In order to use WPGraphQL for Advanced Custom Fields, you must have [WPGraphQL](https://github.com/wp-graphql/wp-graphql) and [Advanced Custom Fields](https://advancedcustomfields.com) (free or pro) installed and activated.

Adding Fields to the WPGraphQL Schema
--------------------------------------------------------------------------------------------

[](#adding-fields-to-the-wpgraphql-schema-)

**TL;DR:** [Here's a video](https://www.youtube.com/watch?v=rIg4MHc8elg) showing an overview of usage.

Advanced Custom Fields, or ACF for short, enables users to add Field Groups, either using a [Graphical User Interface](https://www.advancedcustomfields.com/resources/creating-a-field-group/), [PHP code](https://www.advancedcustomfields.com/resources/register-fields-via-php/), or [local JSON](https://www.advancedcustomfields.com/resources/local-json/) to various screens in the WordPress dashboard, such as (but not limited to) the Edit Post, Edit User and Edit Term screens.

Whatever method you use to register ACF fields to your WordPress site should work with WPGraphQL for Advanced Custom Fields. For the sake of simplicity, the documentation below will *primarily* use the Graphic User Interface for examples.

### Add ACF Fields to the WPGraphQL Schema

[](#add-acf-fields-to-the-wpgraphql-schema)

The first step in using Advanced Custom Fields with WPGraphQL is to [create an ACF Field Group](https://www.advancedcustomfields.com/resources/creating-a-field-group/).

By default, field groups are *not* exposed to WPGraphQL. You must opt-in to expose your ACF Field Groups and fields to the WPGraphQL Schema as some information managed by your ACF fields may not be intended for exposure in a queryable API like WPGraphQL.

#### Show in GraphQL Setting

[](#show-in-graphql-setting)

To have your ACF Field Group show in the WPGraphQL Schema, you need to configure the Field Group to "Show in GraphQL".

##### Using the ACF GUI

[](#using-the-acf-gui)

When using the ACF Graphic User Interface for creating fields, WPGraphQL for Advanced Custom Fields adds a **Show in GraphQL** field to Field Groups.

Setting the value of this field to "Yes" will show the field group in the WPGraphQL Schema, if a [GraphQL Field Name](#graphql-field-name) is also set

[![Show in GraphQL Setting for ACF Field Groups](https://github.com/wp-graphql/wp-graphql-acf/raw/master/docs/img/field-group-show-in-graphql.png?raw=true)](https://github.com/wp-graphql/wp-graphql-acf/blob/master/docs/img/field-group-show-in-graphql.png?raw=true)

##### Registering Fields in PHP

[](#registering-fields-in-php)

When registering ACF Fields in PHP, you need to add `show_in_graphql` and `graphql_field_name` when defining your field group. See below as an example.

```
function my_acf_add_local_field_groups() {

	acf_add_local_field_group(array(
		'key' => 'group_1',
        'title' => 'My Group',
        'show_in_graphql' => true,
        'graphql_field_name' => 'myGroup',
		'fields' => array (
			array (
				'key' => 'field_1',
				'label' => 'Sub Title',
				'name' => 'sub_title',
				'type' => 'text',
			)
		),
		'location' => array (
			array (
				array (
					'param' => 'post_type',
					'operator' => '==',
					'value' => 'post',
				),
			),
		),
	));

}

add_action('acf/init', 'my_acf_add_local_field_groups');
```

Each individual field will inherit its GraphQL name from the supplied `name` tag. In this example, `sub_title` will become `subTitle` when requested through GraphQL. If you want more granular control, you can pass `graphql_field_name` to each individual field as well.

Supported Fields
----------------

[](#supported-fields)

In order to document interacting with the fields in GraphQL, an example field group has been created with one field of each type.

To replicate the same field group documented here you can download the [example field group](https://github.com/wp-graphql/wp-graphql-acf/blob/master/docs/field-group-examples-export.json) and [import it](https://support.advancedcustomfields.com/forums/topic/importing-exporting-acf-settings/) into your environment.

For the sake of documentation, this example field group has the [location rule](#location-rules) set to "Post Type is equal to Post", which will allow for the fields to be entered when creating and editing Posts in the WordPress dashboard, and will expose the fields to the `Post` type in the WPGraphQL Schema.

[![Location rule set to Post Type is equal to Post](https://github.com/wp-graphql/wp-graphql-acf/raw/master/docs/img/location-rule-post-type-post.png?raw=true)](https://github.com/wp-graphql/wp-graphql-acf/blob/master/docs/img/location-rule-post-type-post.png?raw=true)

Options Pages
-------------

[](#options-pages)

**Reference**:

To add an option page and expose it to the graphql schema, simply add 'show\_in\_graphql' =&gt; true when you register an option page.

**Example Usage**

```
function register_acf_options_pages() {

    // check function exists
    if ( ! function_exists( 'acf_add_options_page' ) ) {
        return;
    }

    // register options page
    $my_options_page = acf_add_options_page(
        array(
            'page_title'      => __( 'My Options Page' ),
            'menu_title'      => __( 'My Options Page' ),
            'menu_slug'       => 'my-options-page',
            'capability'      => 'edit_posts',
            'show_in_graphql' => true,
        )
    );
}

add_action( 'acf/init', 'register_acf_options_pages' )
Example Query
query GetMyOptionsPage {
    myOptionsPage {
        someCustomField
    }
}
```

Alternatively, it's you can check the Fields API Reference to learn about exposing your custom fields to the Schema.

Location Rules
---------------------------------------------------------

[](#location-rules-)

Advanced Custom Fields field groups are added to the WordPress dashboard by being assigned "Location Rules".

WPGraphQL for Advanced Custom Fields uses the Location Rules to determine where in the GraphQL Schema the field groups/fields should be added to the Schema.

For example, if a Field Group were assigned to "Post Type is equal to Post", then the field group would show in the WPGraphQL Schema on the `Post` type, allowing you to query for ACF fields of the Post, anywhere you can interact with the `Post` type in the Schema.

### Supported Locations

[](#supported-locations)

@todo: Document supported location rules and how they map from ACF to the WPGraphQL Schema

### Why aren't all location rules supported?

[](#why-arent-all-location-rules-supported)

You might notice that some location rules don't add fields to the Schema. This is because some location rules are based on context that doesn't exist when the GraphQL Schema is generated.

For example, if you have a location rule to show a field group only on a specific page, how would that be exposed the the Schema? There's no Type in the Schema for just one specific page.

If you're not seeing a field group in the Schema, look at the location rules, and think about *how* the field group would be added to a Schema that isn't aware of context like which admin page you're on, what category a Post is assigned to, etc.

If you have ideas on how these specific contextual rules should be handled in WPGraphQL, submit an issue so we can consider how to best support it!

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity58

Moderate usage in the ecosystem

Community39

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 72.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~110 days

Recently: every ~274 days

Total

18

Last Release

665d ago

PHP version history (2 changes)v0.5.0PHP ^7

v0.5.3PHP ^7.1 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1260765?v=4)[Jason Bahl](/maintainers/jasonbahl)[@jasonbahl](https://github.com/jasonbahl)

---

Top Contributors

[![jasonbahl](https://avatars.githubusercontent.com/u/1260765?v=4)](https://github.com/jasonbahl "jasonbahl (224 commits)")[![markkelnar](https://avatars.githubusercontent.com/u/749603?v=4)](https://github.com/markkelnar "markkelnar (25 commits)")[![kidunot89](https://avatars.githubusercontent.com/u/13604318?v=4)](https://github.com/kidunot89 "kidunot89 (18 commits)")[![rsm0128](https://avatars.githubusercontent.com/u/45686588?v=4)](https://github.com/rsm0128 "rsm0128 (10 commits)")[![jacobarriola](https://avatars.githubusercontent.com/u/1371573?v=4)](https://github.com/jacobarriola "jacobarriola (5 commits)")[![esamattis](https://avatars.githubusercontent.com/u/225712?v=4)](https://github.com/esamattis "esamattis (4 commits)")[![seagyn](https://avatars.githubusercontent.com/u/743964?v=4)](https://github.com/seagyn "seagyn (2 commits)")[![BronsonQuick](https://avatars.githubusercontent.com/u/1377956?v=4)](https://github.com/BronsonQuick "BronsonQuick (2 commits)")[![rodrigo-arias](https://avatars.githubusercontent.com/u/11416255?v=4)](https://github.com/rodrigo-arias "rodrigo-arias (2 commits)")[![yanmorinokamca](https://avatars.githubusercontent.com/u/48559501?v=4)](https://github.com/yanmorinokamca "yanmorinokamca (2 commits)")[![ljanecek](https://avatars.githubusercontent.com/u/2696545?v=4)](https://github.com/ljanecek "ljanecek (1 commits)")[![pickleat](https://avatars.githubusercontent.com/u/39109475?v=4)](https://github.com/pickleat "pickleat (1 commits)")[![RodrigoTomeES](https://avatars.githubusercontent.com/u/13077343?v=4)](https://github.com/RodrigoTomeES "RodrigoTomeES (1 commits)")[![sboerrigter](https://avatars.githubusercontent.com/u/786875?v=4)](https://github.com/sboerrigter "sboerrigter (1 commits)")[![seripap](https://avatars.githubusercontent.com/u/683200?v=4)](https://github.com/seripap "seripap (1 commits)")[![speedpro](https://avatars.githubusercontent.com/u/9342516?v=4)](https://github.com/speedpro "speedpro (1 commits)")[![khaosophy](https://avatars.githubusercontent.com/u/6993800?v=4)](https://github.com/khaosophy "khaosophy (1 commits)")[![caco-jr](https://avatars.githubusercontent.com/u/15459781?v=4)](https://github.com/caco-jr "caco-jr (1 commits)")[![davidshq](https://avatars.githubusercontent.com/u/8009774?v=4)](https://github.com/davidshq "davidshq (1 commits)")[![dgaidula](https://avatars.githubusercontent.com/u/1051242?v=4)](https://github.com/dgaidula "dgaidula (1 commits)")

---

Tags

advanced-custom-fieldsapigraphqlhacktoberfestwordpresswpgraphql

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/wp-graphql-wp-graphql-acf/health.svg)

```
[![Health](https://phpackages.com/badges/wp-graphql-wp-graphql-acf/health.svg)](https://phpackages.com/packages/wp-graphql-wp-graphql-acf)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
