Skip to contentSkip to main navigation Skip to footer

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.

  1. Go to Squirrly SEO > All Features and turn on Custom Rich Snippets and Reusable Schemas.
  2. In ACF, add the byline fields to your posts. This guide uses written_by (a Post Object that points to your People post type) and technical_review_by (a User field). You can use any field names, as long as you use the same names in the patterns below.
  3. On each person’s profile, add the details you want to publish: job_title (Text) and same_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.
  4. Go to Squirrly SEO > Reusable Schemas, click Create Reusable Schema and choose Article.
  5. Fill the Author and Reviewed By fields with the patterns from the table below.
  6. 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 fieldAuthorReviewer
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.

KeyLinked post (Post Object, Relationship, Page Link)Linked user (User field)
namePost titleDisplay name
urlPost linkAuthor page link
imageFeatured imageProfile picture (Gravatar)
descriptionExcerptBiographical Info
Any other key, such as job_titleThat ACF field on the linked postThat 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:

  1. Use the field name, not the field label. You find it in ACF under Field Name.
  2. Do not add spaces inside the braces. {{customfield( price )}} will not work.
  3. 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

Was This Article Helpful?

0 Comments

There are no comments yet

Leave a comment

Before you leave

Learn how AI search is changing visibility

A free course from the AISQ Growth team, built from real experiments, not theory.

ChatGPT traffic proven

Worksheets & templates included

No paywall

Free now, free forever

No credit card. No paywall. Lifetime access.

It’s time to stop orbiting SaaS.

Be the Meteor.

10 Elite Tools. 1 Stack.