Create an automatic FAQ schema with ACF repeater fields

You can use ACF (Advanced Custom Fields) plugin and the repeater field to build an automatic FAQ schema.

To do that, go to SEO, Schemas, Add Schema.

Select FAQ as data type, choose the display conditions (eg: “product” post type).

Choose Manual Text for Question and Answer properties.

Enter the name of your ACF subfield for each property (see screenshot).

Automatic FAQ schema with ACF - SEOPress PRO
Automatic FAQ schema with ACF – SEOPress PRO

Publish your schema.

Now copy and paste this code to your functions.php file of your child theme.

Replace acf_repeater_faq by the name of your ACF repeater (lines 3, 8 and 13).

Replace faq_question and faq_answer with the names of your subfields (lines 16 and 17).

Below our ACF configuration with a repeater field and our two subfields (question and answer):

FAQ repeater field with ACF plugin
FAQ repeater field with ACF plugin

Et voilà!

Last modified: November 14, 2020