Question and answer page (Q&A Page) schema markup is a schema.org type that is used for pages that contain a question and one or multiple answers to that question.
It's great for FAQ pages, or for a page with a single question proposed, and multiple answers given by users.
It's also great for SEO purposes because structured pages are better indexed by Google.

Q&A Page Schema Markup requires 3 schema classes:

  1. QAPagehttps://schema.org/QAPage )

  2. Questionhttps://schema.org/Question )

  3. Answerhttps://schema.org/Answer )


To create a QAPage Structured FAQ page:

  • just after the <!DOCTYPE html> tag insert:
    <html itemscope itemtype=”http://schema.org/QAPage”>

  • each question needs to be proposed as:
    <div itemscope itemtype=”http://schema.org/Question”>
        <div itemprop=”text”>Who is John Doe?</div>
    </div>

  • and each following answer as:
    <div itemscope itemtype=”http://schema.org/Answer”>
        <div itemprop=”text”>John Doe a fictitious name used in legal proceedings for a male party whose true name is not known.</div>
    </div>


A full and simple FAQ page code example using Microdata:


<div itemscope itemtype="http://schema.org/FAQPage">
    <div itemscope itemprop="mainEntity" itemtype="http://schema.org/Question">
        <h2 itemprop="name" class="classyschema-faqpage-question">Who is John Doe?</h2>
        <div itemscope itemprop="acceptedAnswer" itemtype="http://schema.org/Answer">
            <div itemprop="text">
                <p>John Doe a fictitious name used in legal proceedings for a male party whose true name is not known.</p>
            </div>
        </div>
    </div>
    <div itemscope itemprop="mainEntity" itemtype="http://schema.org/Question">
        <h2 itemprop="name" class="classyschema-faqpage-question">How old is John Doe?</h2>
        <div itemscope itemprop="acceptedAnswer" itemtype="http://schema.org/Answer">
           <div itemprop="text">
               <p>No one knows how old is John Doe.</p>
           </div>
        </div>
    </div>
</div>

 

the result of this code is: 

Who is John Doe?

John Doe a fictitious name used in legal proceedings for a male party whose true name is not known.

How old is John Doe?

No one knows how old is John Doe.

 

NOTE

You can customize code by adding a class attribute, such as:

<div itemscope itemprop="acceptedAnswer" itemtype="http://schema.org/Answer" class="my-CSS-class">

 

After having compiled the page, check it using the Google Rich Results Test Tool: https://search.google.com/test/rich-results?hl=en

 

Found this article interesting?
Subscribe to DomainRegister´s newsletter!

You can unsubscribe at any time by simply clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp s privacy practices here.

  • HTML, Microdata, SEO
  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

 How To Insert a Carriage Return in a PHP String

If you need to insert a Carriage Return in a string in PHP: Carriage return is: "\r"  But...

 How to Create a phpinfo page

The phpinfo() function outputs a huge amount of information about the system you're using, such...

 How To Make a Redirect in PHP

If you want that a page redirects automatically the user to a certain page or site (let's say,...

 How To Configure Easy WP SMTP Plugin To Use Gmail SMTP Service

Easy WP SMTP is a popular and free plugin for WordPress to send email(s) by an authenticated SMTP...

 How to Backup Your MySQL Database Using PHP

This simple PHP script will provide a full dump of your MySQL database.You need to provide...