In this video I’ll show you how you can create Structured Data for FAQ pages that produce a Rich Snippet in search results. In this case something like an accordion that collapses when you click on it!
Links from the Video:
- Googles Reference the FAQ markup
- Structured Data Generator
- Googles Rich Results Test Tool
- Export code (that you can use to import the snippet)
In this video I would like to show how to get accordions on search result pages. This will make your search result appear even bigger. And there is more to it than that! The individual questions and answers are clickable, too!
Hi and welcome back! Nice to have you in the eight lesson of module 3 of my structured data training. I am Florian the developer of SNIP, the Structured Data & Schema Plugin for WordPress. If you want to use the plugin please feel free to follow the link that you can find in the description area. In this video I want to show you how an FAQ markup is built.
Hopefully you have watched all the lessons from the previous modules. If not, please skip back to the beginning or to a video where you feel you need to refresh your knowledge. In this video it’s important that you’ve understood what Structured Data is and what Rich Snippets are. You need to know how and where you can find the right schema classes as well as their properties to create the FAQ markup.
But now: let’s jump right in!
The FAQ Markup
A Frequently Asked Question (FAQ) page contains a list of questions and answers about a specific topic. Properly marked up FAQ pages can be eligible for a rich result in search and an action in Google Assistant, which can help your website reach the right users.
As you can see, depending on the number of questions, you’ll also get a „Show more“ button which makes your search result even bigger when clicked.
Read the references
Googles Reference & schema.org
As always we open up Google’s reference to see what properties we need. The understanding around a FAQ page is relatively simple. After all, there are several questions and the respective answers to them. However, the markup for it is a bit more complicated because many properties and sub-schemas are needed.
Google uses structured data from schema.org. In this case we need three schema-types. The FAQPage schema of course, the Question– and the Answer-Schema.
On that pages you can find all properties that are possible. However, as you could see on Googles reference page: you don’t need every single property listed there. You only need the required ones to get the nice looking search result.
Let’s start to generate the snippet!
Create a Global Snippet
But before we start, here is a quick side note:
In the video I’ll use the built-in Generator in SNIP, my Structured Data & Schema Plugin for WordPress. If you don’t have the plugin, please feel free to use the Structured Data Generator on my Website to follow the video-instructions.
The free generator does not have all the features the built-in generator has. So it might be that you get stuck at some point. Especially when it comes to Global Snippets that allow you to automate the schema generation.
Let’s jump right in!
Because we want to use the FAQPage on multiple posts we set up a Global Snippet. If you want to learn more about Global Snippets please jump back to module 2 of my structured data training where I explain in every detail what Global Snippets are and how they work altogether.
SNIP comes shipped with a Setup Wizard that helps you getting started. I’ll not use the Setup Wizard for now but we’ll import the example that I provide on my site to speed things up. You can follow the link in the description area to find it. Now just copy the code.
We’ll then create a new Schema Template and import that code. After the import has finished we see one property, the mainEntity property which has a sub-schema “Question”.
The Question sub-schema has two properties: The name (which according to Googles guidelines should be the question text) and the acceptedAnswer property. The latter one has a sub-schema of Answer which has another property called text. This text property should inherit the answer to the above question.
As you can see, all properties are marked overridable. This will allow us to fill-in text on a per-post-basis. The mainEntity property also has the “List” checkmark set. This allows us to add multiple questions. You will see how this works in a moment.
So now you can see why I said it’s quite complicated. Lots of sub-schemas and sub-properties are needed. However it should be quite simple to use once it’s setup correctly. Remember: You only need to do this once!
Last but not least we need to define where this Global Snippet should be included. I’ve created a category where all my FAQ posts are. So I’ll set the rule to “Post Category is equal to FAQPosts”.
Don’t forget to publish your new schema template.
Overwrite on a per-post basis
Now we actually need to fill-in the values. As I’ve mentioned beforehand, I’ve a category with all my posts that are actually FAQ posts. I have already created a sample page with three questions and answers.
After it has opened up, click the “Edit Global Snippets” button on the right. It brings up a new window where we click the name of our newly created Schema Template. In my case it’s “FAQPage Schema”. It will then load the actually form that allows us to add content.
As you can see I’ve added the actual questions and answers already. Because I’ve three questions on that page I’ve three mainEntity properties and therefore three Question schemas. The Question schemas have the question text and the Answer sub-schema with the answer in the text property.
I could add more questions and answers by clicking the + sign to the right.
After you’ve done that, hit the save button and close the window.
Repeat this with all the other posts that have FAQPage schemas.
Validate the Snippet
After all of that we should check the output of the plugin using Googles Rich Results Test Tool to verify that everything is okay. For this I open up the test tool in a new browser window.
As always you should enter the URL to a specific post here. I need to enter the output of the plugin manually because I am on a local development site where this tool has no access to. So I run the test and you wouldn’t believe it: I get a green “Page is eligible for rich results” which is a good sign!
The “Preview” button will show you how your Rich Snippet could look like. In my case it looks a little weird as it shows the actual code for the title and text. But don’t worry, this is just because I was not able to provide an URL to the page. Moreover, the test tool does not always display the correct rich snippet, as you can see from the text below. It says “This is just a simulation! Actual appearance or behavior on Google is not guaranteed.”
Alright. Let’s sum everything up what we have learned in this video.
- At the time of the making of this video the FAQPage snippet shows an accordion in search results.
- The FAQPage schema has only one property, the mainEntity. However we need to more sub-schemas: The Question- and the Answer-Schema.
- To find the right properties we used Google’s reference pages and schema.org as always.
- In this video we used the overridable and list-checkbox which allowed us to add questions and answers on a per-post basis.
That’s it for now! If you are interested in other Rich Snippets and how they are built please consider watching another video created by me. See you there! Bye bye!