Feature request: Add FAQ Schema to Accordions

Hi @alexander

I’ll leave this here rather than on the main forum.

So Accordions are very often used for FAQs. I figured, why not having a checkbox that could generate the FAQ Schema taken from the Accordion content?

I am not sure about the technicalities, but this:

image

Should generate this:

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

Having this would strengthen the position of Pro as one of the SEO friendliest themes out there. Which it already is. :slight_smile:

7 Likes

The Schema output should be optional since some may already output the Schema through some other method.

@JvP, absolutely. Some other elements have the “Schema” checkbox as an option, so this should be the same.

3 Likes

Hi @Misho,

Thanks for pointing this out! Great idea. Unfortunately, because of how the Accordion Items are separate elements than the parent, this one isn’t a super easy action item. We don’t plan on making any changes to it for now.

Schema markup is definitely one of those holy grail things that if done right makes a huge difference. A big challenge though is how all the types of schema have different formats and expect different things happening in the DOM. I’ve got some notes written up on this, but the biggest thing we’re considering for better schema markup is adding a JSON-LD control in the “Customize” section and just letting you place anything you want on any element. It’d be a bit more manual, but would offer the most flexibility and opportunity.

We’ve also done some experimentation with running loopers inside Dynamic Content. So technically, if you defined your Accordion items as Looper Data, you could loop over it once for the element output, but then loop over it again in this JSON-LD control to populate the schema markup however you want. Then it would maintain the right structure as looper items are added and removed.

I’m not sure where this fits into the timeline just yet. Once the Theme Options reboot is concluded, we should have all the right tech internally to do this fairly easily. It’s really early to discuss specifics, but this is what we’re thinking at the moment to approach schema markup across the board.

3 Likes

Hey Alexander, not sure what the overall goal for the snippet extension was, but I always thought of it as the tag along to make X more SEO friendly, perhaps more options can come to snippet that would continue to keep its role as a beginner friendly SEO tool meanwhile the JSON-LD can be for more advanced users?

Dynamic content in the Snippet addon fields would open so much possibilities.

1 Like

@dmedianik, Snippet is a good solution for setting up some site wide schema markup rules. It isn’t really a good way to define custom schema on a per page basis. I think the ideal solution would be having more controls on the Settings tab. If you’re editing a Layout, you could define schema that applies to anything that receives the Layout via assignment rules. If you’re editing a post or page directly, you could provide specific schema details.