Search code examples
htmlschema

How to add schema markup to FAQ HTML code


I have blow code for FAQ section in my website. And I want to add standard schema markup to this HTML code.

<div class="ts-faq-accordion-content">
     <div class="ts-faq-accordion-item">
         <div class="ts-faq-item-header">
             <h4 class="ts-faq-item-question">
                    How to add schema markup to FAQ HTML code?
             </h4>
             <div class="ts-faq-item-icon">
                 <i class="down-icon"></i>
             </div>
         </div>
         <div class="ts-faq-item-content">
             <p class="ts-faq-item-answer">
                 Your Content Meets Google Guidelines for FAQPage. Google has guidelines you need to follow in order to enable rich results.
             </p>
         </div>
     </div>
 </div>

Solution

  • answer:

    <div class="ts-faq-accordion-content" itemscope itemtype="http://schema.org/FAQPage">
    
      <div class="ts-faq-accordion-item" itemprop="mainEntity" itemscope itemtype="http://schema.org/Question">
          <div class="ts-faq-item-header">
              <h4 class="ts-faq-item-question" itemprop="name">
                How to add schema markup to FAQ HTML code?
              </h4>
          <div class="ts-faq-item-icon">
            <i class="down-icon"></i>
          </div>
        </div>
        <div class="ts-faq-item-content" itemprop="acceptedAnswer" itemscope itemtype="http://schema.org/Answer">
            <p class="ts-faq-item-answer" itemprop="text">
              Your Content Meets Google Guidelines for FAQPage. Google has guidelines you need to follow in order to enable rich results.
            </p>
        </div>
      </div>
      
    </div>