Use ACF Fields in Squirrly SEO Schemas

Squirrly SEO can fill any schema field with a value from an Advanced Custom Fields (ACF) field, through the patterns {{customfield(name)}} and {{customfields(field|key)}}. Each page then gets its own author, reviewer, price or date in the JSON-LD from one schema you set up once.
The schema forms that take these patterns need the Squirrly SEO Advanced Pack. The examples come from Squirrly SEO 14.2.9 with the Advanced Pack 2.5.11.
What you need
| Item | Where to check it |
|---|---|
| Squirrly SEO with JSON-LD Structured Data on | Squirrly > All Features |
| The Advanced Pack with Custom Rich Snippets on (see custom schemas) | Squirrly > All Features |
| Reusable Schemas on, to use one schema on many posts | Squirrly > All Features |
| ACF, free or Pro, with the fields on your posts | Plugins in WordPress |

The two patterns
{{customfield(price)}}
{{customfields(location|address)}}| Pattern | What it returns | Use it for |
|---|---|---|
{{customfield(name)}} | The value saved in that field on the current post, as text | Text, Number, Date, Email and URL fields |
{{customfields(field|key)}} | One key of a field with several values, or one detail of the post or user the field links to | Group fields, Image fields and relation fields |
Write the field name, not the label. ACF shows it under Field Name. Don’t put spaces inside the braces, because {{customfield( price )}} returns nothing.
What each key returns for a linked person
When the field is a Post Object, Relationship, Page Link or User field, the key reads from the profile it points to:
| Key | Linked post | Linked user |
|---|---|---|
name | Post title | Display name |
url | Post link | Author page link |
image | Featured image | Profile picture (Gravatar) |
description | Excerpt | Biographical Info |
Any other key, such as job_title | That ACF field on the linked post | That ACF field on the user’s profile |
An Image field gives its URL whatever its return format is. A Text Area or a field with several values gives one item per line. If the field links to more than one person, Squirrly uses the first one, and a linked post must be published.
Show the real author and reviewer of each article
This setup reads the author and the reviewer from two ACF fields on each article. The field names written_by and technical_review_by are examples, so use your own and keep the same names in the patterns.
- In ACF, add
written_by(a Post Object pointing to your People post type) andtechnical_review_by(a User field) to your posts. - On each person’s profile, add
job_title(Text) andsame_as(Text Area, one profile link per line). Set the featured image as the person’s photo. - Go to Squirrly > Reusable Schemas > Schemas, click Create Reusable Schema and pick Article.
- Fill the author and reviewer fields with the patterns from the table below.
- Type a Reusable Name and save the schema.
| Schema field | Pattern |
|---|---|
| Author Name | {{customfields(written_by|name)}} |
| Author URL | {{customfields(written_by|url)}} |
| Author Job Title | {{customfields(written_by|job_title)}} |
| Author Image URL | {{customfields(written_by|image)}} |
| Author Same As | {{customfields(written_by|same_as)}} |
| Reviewer Name | {{customfields(technical_review_by|name)}} |
| Reviewer URL | {{customfields(technical_review_by|url)}} |
| Reviewer Job Title | {{customfields(technical_review_by|job_title)}} |
| Reviewer Image URL | {{customfields(technical_review_by|image)}} |
| Reviewer Same As | {{customfields(technical_review_by|same_as)}} |
Now attach the schema to the articles:
| For | Do this |
|---|---|
| Every post of a type | Go to Squirrly > Optimize > Automation, click the post type and pick the reusable schema in JSON-LD Type (see Automation) |
| One post | Open the post’s SEO Snippet, go to Rich Snippets and click Add Reusable Schema |
Each article reads its own written_by and technical_review_by, so one schema covers all your authors. The reviewer goes on the article’s WebPage as reviewedBy, because schema.org defines it there. The article:author Open Graph tag then names the same person as the Article schema.
Use any other ACF field
The same patterns work in any schema field of the Advanced Pack, including a schema you add to one post with Add New Schema.
| Example | Pattern |
|---|---|
| Product price | {{customfield(price)}} |
| Event start date | {{customfield(event_date)}} |
| Dataset license URL | {{customfield(license_url)}} |
| LocalBusiness phone from a Group field | {{customfields(contact|phone)}} |
When you edit a schema on a post that already has custom fields filled in, the form lists those fields as patterns you can click. Reusable Schemas shows that list.
Troubleshooting
A schema field stays empty on every post
The field name in the pattern is wrong or has spaces inside the braces. Copy the name from Field Name in ACF.
The author is empty on some posts
Those posts have no value in the relation field, or the linked profile isn’t published. Fill the field and update the post.
“Not published yet – Google needs: …”
A required field of the schema resolved to nothing on that post. The message names the field, and the post needs a value in the ACF field behind it.
Frequently asked questions
Does this work with ACF Pro?
Yes, the patterns read ACF fields the same way in the free and the Pro version.
Can I use the patterns in the SEO title or description?
{{customfield(name)}} also works in titles and descriptions, as custom fields in SEO metadata explains.
What happens when a field links to two authors?
Squirrly uses the first one.
Related tutorials
- Rich Snippets: Reusable Schemas: create a schema once and use it on many pages.
- Automation: set the JSON-LD type for each post type.
- JSON-LD Structured Data: the global Person, Organization and Local SEO settings.
- The Squirrly SEO Patterns List: every pattern for titles, descriptions and schemas.
- Squirrly SEO & Advanced Custom Fields: custom JSON-LD and video from ACF fields.




0 Comments