How to build a Question-And-Answer snippet

Ben asked the question on how to add Questions and Answers. Here is a quick “How to” for a single post. Basically you need two schema types here: Question and QAPage.

1. Create a “Question” schema type

  • First of all: Create a new post or edit an existing one.
  • Then scroll down to the Rich Snippets metabox and type “Question” into the “Select a thing” field:
Rich Snippets Metabox with Question-Thing Dropdown
Rich Snippets Metabox with Question-Thing Dropdown Select “Question” from the dropdown
  • At this point in time the plugin will not load any properties. You have to load them one by one on your own. So let’s jump over to the schema.org Question page to see what properties we need.
  • The example on the end of the above mentioned page shows that we need name and text. So we’ll add them:
Text property field on schema.org question class
Text property field on schema.org question class Search for properties and select the right ones
schema.org Question properties
schema.org Question properties We fill the fields.
  1. What’s missing now is the answer (if there is one). The W3C suggests to use the acceptedAnswer property like this:
  2. Add the acceptedAnswer property.
  3. Select “Answer” from the dropdown:
selectedAnswer dropdown shows the Answer schema class
selectedAnswer dropdown shows the Answer schema class Select “Answer” from the dropdown that you can find under “Related items”
  • In the new loaded schema class (Answer) you can now load the property “text” that holds the answer:
The full acceptedAnswer schema property
The full acceptedAnswer schema property The full acceptedAnswer schema property

The full property-list should now look like this:

Full Question property list
Full Question property list The full question property list

2. Create QAPage schema type

Now we need a QAPage schema type as well. So we create a second snippet on the same page with the following attributes:

  • name = the question
  • description = the question text

That’s it!

3. What’s next?

Of course you can always use more properties if you want to. Just take a look to the Question and the Answer page on schema.org to see what properties are supported.