Site logo

Archived topic

GP Blocks / structured data / faq

3 replies · Started by Jan on July 18, 2022

Viewing posts 1–4 of 4

Hi David,

I'd like to embed structured data into a FAQ section built with two GB containers and headline blocks.

An online generator tool like this would provide me with the JSON-LD to add to an HTML block.

This issue is that this JSON-LD includes both question and answer into the same snippet. For my template, however, I need two code snippets, one for the question and one for the answer.

When I look at the html of the Yoast FAQ block they seem to use and ID in order to a questions to the relevant answer (see screenshot).

How would you go about splitting the following:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "This is the Question.",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Here comes the Answer."
      }
    }
  ]
}
</script>

Any advise would be much appreciated.

Best,
Jan

Thanks!

This archived topic is closed to new replies.