Use ACF fields in Squirrly SEO schemas
Squirrly SEO can read Advanced Custom Fields (ACF) in its schemas. Each page can show the real author and reviewer from your ACF profiles, along with any other field you have saved.
What you need
- Squirrly SEO 14.2.7 or newer
- Squirrly SEO Advanced Pack 2.5.10 or newer (the schemas are part of the Advanced Pack)
- ACF 6 or newer, free or Pro
Each post also needs one ACF field that points to the person:
- Post Object, Relationship or Page Link when your authors are profile pages, such as a People post type.
- User when your authors are WordPress users.
Each person’s details, like job title, profile links and photo, are stored on their profile. You enter them once and every article uses them.
Show the real author and reviewer
After this setup, each article shows the person from its “Written by” field as the author, with their job title, photo and profile links. The reviewer is added to the article’s web page as reviewedBy, and the article:author meta tag matches the author.
- Go to Squirrly SEO > All Features and turn on Custom Rich Snippets and Reusable Schemas.
- In ACF, add the byline fields to your posts. This guide uses
written_by(a Post Object that points to your People post type) andtechnical_review_by(a User field). You can use any field names, as long as you use the same names in the patterns below. - On each person’s profile, add the details you want to publish:
job_title(Text) andsame_as(Text Area, one profile link per line, such as LinkedIn, ORCID or Google Scholar). Set the profile’s featured image as the person’s photo. - Go to Squirrly SEO > Reusable Schemas, click Create Reusable Schema and choose Article.
- Fill the Author and Reviewed By fields with the patterns from the table below.
- Save the schema, then add it to your articles:
- For every post of a type: go to Squirrly SEO > Automation > Configuration, choose the post type and select the schema in JSON-LD Types.
- For a single post: open the post’s SEO Snippet > Rich Snippets and click Add Reusable Schema.
| Schema field | Author | Reviewer |
|---|---|---|
| Name | {{customfields(written_by|name)}} | {{customfields(technical_review_by|name)}} |
| URL | {{customfields(written_by|url)}} | {{customfields(technical_review_by|url)}} |
| Job Title | {{customfields(written_by|job_title)}} | {{customfields(technical_review_by|job_title)}} |
| Image URL | {{customfields(written_by|image)}} | {{customfields(technical_review_by|image)}} |
| Same As | {{customfields(written_by|same_as)}} | {{customfields(technical_review_by|same_as)}} |
Each article reads its own written_by and technical_review_by fields, so one reusable schema works for all your authors. The same patterns also work in a schema you add to a single post with Add New Schema.
What each key returns
In {{customfields(field|key)}}, field is the ACF field on the article and key is what to read from the person it links to.
| Key | Linked post (Post Object, Relationship, Page Link) | Linked user (User field) |
|---|---|---|
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 ACF Image field always returns its URL, whether its return format is Array, URL or ID.
- A Text Area, or any field with multiple values, gives one item per line.
- If a field links to several people, the first one is used.
Use any other ACF field in a schema
The same patterns work in any schema field, not only for people. There are two forms:
{{customfield(price)}}
{{customfields(location|address)}}{{customfield(name)}}returns the value saved for that field on the current post, exactly as it is stored in the database. Use it for Text, Number, Date, Email and URL fields.{{customfields(field|key)}}reads one part of a field that has several values: a key from a Group or Image field, or a key from the post or user that a relation field points to.
A few rules:
- Use the field name, not the field label. You find it in ACF under Field Name.
- Do not add spaces inside the braces.
{{customfield( price )}}will not work. - Each schema keeps its own patterns. When you save a schema as reusable, every post that uses it reads its own ACF values.
Examples:
- Product price:
{{customfield(price)}} - Event start date:
{{customfield(event_date)}} - Dataset license URL:
{{customfield(license_url)}} - LocalBusiness phone:
{{customfields(contact|phone)}}
Related articles
- Rich Snippets: Reusable Schemas: create a schema once and use it on many pages.
- Automation: set the JSON-LD types for each post type.
- JSON-LD Structured Data: the global Person, Organization and Local SEO settings.
- How to Incorporate Values from Custom Fields into the Custom Schema / SEO: custom field patterns in SEO metas and schemas.
- The Squirrly SEO Patterns List: every pattern you can use in titles, descriptions and schemas.
- Squirrly SEO & Advanced Custom Fields (ACF) Plugin: set the SEO title, description, keywords and custom JSON-LD from ACF fields.
- What’s the Full List of JSON-LD Structured Data / Schema Markup: all schema types Squirrly SEO supports.




0 Comments