Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

How to add FAQ schema code in HTML format?

         

dhalder

5:14 pm on Jul 28, 2022 (gmt 0)

5+ Year Member



Is there any way to add FAQ schema in HTML format rather than json etc. code and that'll be read as a FAQ schema by Google?

I have tried with following codes but this not read by Google as FAQ schema.

<div itemscope="" itemtype="https://schema.org/FAQPage">
<h2>Frequently Asked Questions</h2>
<div itemscope="" itemprop="mainEntity" itemtype="https://schema.org/Question">
<div itemprop="name">
<h3>Questions text</h3>
</div>
<div itemscope="" itemprop="acceptedAnswer" itemtype="https://schema.org/Answer">
<div itemprop="text">
<p>Answer text</p>
</div>
</div>
</div>
</div>

Sgt_Kickaxe

8:30 am on Jul 30, 2022 (gmt 0)



There is likely several ways to implement this but for Google to recognize it on HTML pages try the following...

- Declare FAQPage schema at the page level, top of the page
<!DOCTYPE html>
<html lang="en" itemscope itemtype="https://schema.org/FAQPage">


- The rest you can implement at the div level. Make sure the answer div is inside the question div else Google doesn't link them.
<div itemscope itemprop="mainEntity" itemtype="https://schema.org/Question">
<h2 itemprop="name">Your question goes here</h2>
<div itemscope itemprop="acceptedAnswer" itemtype="https://schema.org/Answer">
<p itemprop="text">Your answer goes here</p>
</div></div>


You can add multiple questions by repeating this section above as many times as you need but only declare FAQPage once to keep Google happy.

dhalder

5:40 am on Aug 1, 2022 (gmt 0)

5+ Year Member



Thank you so much!