Q&A
Q&A pages are web pages that contain data in a question and answer format, which is one question
followed by its answers. For content that represents a question and its
answers, you can mark up your data with the
schema.org QAPage
, Question
, and Answer
types.
Properly marked up pages are eligible to have a rich result displayed on the search results page. This rich treatment helps your site reach the right users on Search. Here's an example of a result you might see for the user query "How do I remove a cable that is stuck in a USB port?" if the page has been marked up to answer that question:
In addition to enabling your content for the rich result treatment shown above, marking up your Q&A page helps Google generate a better snippet for your page. In the example above, the content from the answers may appear in the basic result if the rich result is not shown.
How to add structured data
Structured data is a standardized format for providing information about a page and classifying the page content. If you're new to structured data, you can learn more about how structured data works.
Here's an overview of how to build, test, and release structured data. For a step-by-step guide on how to add structured data to a web page, check out the structured data codelab.
- Add the required properties. For information about where to put structured data on the page, watch JSON-LD structured data: Where to insert on the page.
- Follow the guidelines.
- Validate your code using the Rich Results Test.
- Deploy a few pages that include your structured data and use the URL Inspection tool to test how Google sees the page. Be sure that your page is
accessible to Google and not blocked by a robots.txt file, the
noindex
tag, or login requirements. If the page looks okay, you can ask Google to recrawl your URLs. - To keep Google informed of future changes, we recommend that you submit a sitemap. You can automate this with the Search Console Sitemap API.
Examples
The following markup example includes the QAPage
, Question
,
and Answer
type definitions in JSON-LD:
<html> <head> <title>How many ounces are there in a pound?</title> <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "QAPage", "mainEntity": { "@type": "Question", "name": "How many ounces are there in a pound?", "text": "I have taken up a new interest in baking and keep running across directions in ounces and pounds. I have to translate between them and was wondering how many ounces are in a pound?", "answerCount": 3, "upvoteCount": 26, "dateCreated": "2016-07-23T21:11Z", "author": { "@type": "Person", "name": "New Baking User" }, "acceptedAnswer": { "@type": "Answer", "text": "1 pound (lb) is equal to 16 ounces (oz).", "dateCreated": "2016-11-02T21:11Z", "upvoteCount": 1337, "url": "https://example.com/question1#acceptedAnswer", "author": { "@type": "Person", "name": "SomeUser" } }, "suggestedAnswer": [ { "@type": "Answer", "text": "Are you looking for ounces or fluid ounces? If you are looking for fluid ounces there are 15.34 fluid ounces in a pound of water.", "dateCreated": "2016-11-02T21:11Z", "upvoteCount": 42, "url": "https://example.com/question1#suggestedAnswer1", "author": { "@type": "Person", "name": "AnotherUser" } }, { "@type": "Answer", "text": " I can't remember exactly, but I think 18 ounces in a lb. You might want to double check that.", "dateCreated": "2016-11-06T21:11Z", "upvoteCount": 0, "url": "https://example.com/question1#suggestedAnswer2", "author": { "@type": "Person", "name": "ConfusedUser" } } ] } } </script> </head> <body> </body> </html>
<html> <body itemscope itemtype="https://schema.org/QAPage"> <div itemprop="mainEntity" itemscope itemtype="https://schema.org/Question"> <h2 itemprop="name">How many ounces are there in a pound?</h2> <div itemprop="upvoteCount">52</div> <div itemprop="text">I have taken up a new interest in baking and keep running across directions in ounces and pounds. I have to translate between them and was wondering how many ounces are in a pound?</div> <div>asked <time itemprop="dateCreated" datetime="2010-11-04T20:07Z">Nov 11 '10 at 20:07</time></div> <div itemprop="author" itemscope itemtype="https://schema.org/Person"><span itemprop="name">New Baking User</span></div> <div> <div><span itemprop="answerCount">3</span> answers</div> <div><span itemprop="upvoteCount">26</span> votes</div> <div itemprop="acceptedAnswer" itemscope itemtype="https://schema.org/Answer"> <div itemprop="upvoteCount">1337</div> <div itemprop="text"> 1 pound (lb) is equal to 16 ounces (oz). </div> <a itemprop="url" href="https://example.com/question1#acceptedAnswer">Answer Link</a> <div>answered <time itemprop="dateCreated" datetime="2010-12-01T22:01Z">Dec 1 '10 at 22:01</time></div> <div itemprop="author" itemscope itemtype="https://schema.org/Person"><span itemprop="name">SomeUser</span></div> </div> <div itemprop="suggestedAnswer" itemscope itemtype="https://schema.org/Answer"> <div itemprop="upvoteCount">42</div> <div itemprop="text"> Are you looking for ounces or fluid ounces? If you are looking for fluid ounces there are 15.34 fluid ounces in a pound of water. </div> <a itemprop="url" href="https://example.com/question1#suggestedAnswer1">Answer Link</a> <div>answered <time itemprop="dateCreated"datetime="2010-12-06T21:11Z">Dec 6 '10 at 21:11</time></div> <div itemprop="author" itemscope itemtype="https://schema.org/Person"><span itemprop="name">AnotherUser</span></div> </div> <div itemprop="suggestedAnswer" itemscope itemtype="https://schema.org/Answer"> <div itemprop="upvoteCount">0</div> <div itemprop="text"> I can't remember exactly, but I think 18 ounces in a lb. You might want to double check that. </div> <a itemprop="url" href="https://example.com/question1#suggestedAnswer2">Answer Link</a> <div>answered <time itemprop="dateCreated"datetime="2010-12-06T21:11Z">Dec 6 '10 at 21:11</time></div> <div itemprop="author" itemscope itemtype="https://schema.org/Person"><span itemprop="name">ConfusedUser</span></div> </div> </div> </div> </body> </html>
Guidelines
For your Q&A page to be eligible for this rich treatment, you must follow these guidelines:
Content guidelines
- Only use the
QAPage
markup if your page has information in a question and answer format, which is one question followed by its answers. - Users must be able to submit answers to the question. Don't use
QAPage
markup for content that has only one answer for a given question with no way for users to add alternative answers; instead, useFAQPage
. Here are some examples:Valid use cases:
- A forum page where users can submit answers to a single question
- A product support page where users can submit answers to a single question
Invalid use cases:
- An FAQ page written by the site itself with no way for users to submit alternative answers
- A product page where users can submit multiple questions and answers on a single page
- A how-to guide that answers a question
- A blog post that answers a question
- An essay that answers a question
- Don't apply
QAPage
markup to all pages on a site or forum if not all the content is eligible. For example, a forum may have lots of questions posted, which are individually eligible for the markup. However, if the forum also has pages that are not questions, those pages are not eligible. - Don't use
QAPage
markup for FAQ pages or pages where there are multiple questions per page.QAPage
markup is for pages where the focus of the page is a single question and its answers. - Don't use
QAPage
markup for advertising purposes. - Make sure each
Question
includes the entire text of the question and make sure eachAnswer
includes the entire text of the answer. Answer
markup is for answers to the question, not for comments on the question or comments on other answers. Don't mark up non-answer comments as anAnswer
.- Question and answer content may not be displayed as a rich result if it contains any of the following types of content: obscene, profane, sexually explicit, graphically violent, promotion of dangerous or illegal activities, or hateful or harassing language.
- STEM education-related Q&A pages, where the primary focus is to provide a correct answer
to a user-submitted homework question, may be eligible for a Q&A carousel experience.
These pages may only have a single answer that's provided or selected by in-house experts
(instead of users).
Example: An education page where a user submitted a single question, and a top answer is selected by experts.
Structured data type definitions
This section describes the structured data types related to QAPage
.
You must include the required properties for your content to be eligible for display as a rich result. You can also include the recommended properties to add more information to your structured data, which could provide a better user experience.
You can use Google's Rich Results Test to validate and preview your structured data.
QAPage
The QAPage
type indicates that the
page is focused on a specific question and its answer(s). We will only use Question
structured data from pages with QAPage
markup. There should only be one
QAPage
type definition per page.
The full definition of QAPage
is available at https://schema.org/QAPage.
The following table describes the properties of the QAPage
type that are used by Google Search.
Required properties | |
---|---|
|
Question
The |
Question
The Question
type defines the question that this page answers, and includes
the answers, if any, to that question. Exactly one Question
type is expected on the
page, nested under the mainEntity
property of the schema.org/QAPage
. There
should only be one Question
type definition per page.
The full definition of Question
is available at https://schema.org/Question.
Required properties | |||||
---|---|---|---|---|---|
|
Integer
The total number of answers to the question. For example, if there are 15 answers, but only the first 10 are marked up due to pagination, this value would be 15. This may also be 0 for questions with no answers. |
||||
Either acceptedAnswer or suggestedAnswer |
Answer
To be eligible for the rich result, a question must have at least one answer – either an
|
||||
|
Text
The full text of the short form of the question. For example, "How many teaspoons in a cup?". |
Recommended properties | |
---|---|
|
Person or
Organization
The author of the question. |
|
Date or DateTime
The date at which the question was added to the page, in ISO-8601 format. |
|
Text
The full text of the long form of the question. For example, "I'm cooking, and I need to know how many teaspoons are in a cup. How many teaspoons are in 1 cup?" |
|
Integer
The total number of votes that this question has received. If the page supports upvotes and
downvotes, then set the |
Answer
The Answer
type defines the suggested and accepted answers to the
Question
on this page. Define Answers
inside the Question
,
as values for the suggestedAnswer
and acceptedAnswer
properties.
The following table describes the properties of the Answer
type that is used within a
Question
.
The full definition of Answer
is available at
https://schema.org/Answer.
Required properties | |
---|---|
|
Text
The full text of the answer. If only a portion is marked up, your content may not be shown and Google cannot determine the best text to display. |
Recommended properties | |
---|---|
|
Person or
Organization
The author of the answer. |
|
Date or DateTime
The date at which the answer was added to the page, in ISO-8601 format. |
|
Integer
The total number of votes that this answer has received. If the page supports upvotes and
downvotes, then set the |
|
URL
A URL that links directly to this answer. For example: |
Monitor rich results with Search Console
Search Console is a tool that helps you monitor how your pages perform in Google Search. You don't have to sign up for Search Console to be included in Google Search results, but it can help you understand and improve how Google sees your site. We recommend checking Search Console in the following cases:
- After deploying structured data for the first time
- After releasing new templates or updating your code
- Analyzing traffic periodically
After deploying structured data for the first time
After Google has indexed your pages, look for issues using the relevant Rich result status report. Ideally you should see an increase of valid pages, and no increase in errors or warnings. If you find issues in your structured data:
- Fix the errors.
- Inspect a live URL to check if the issue persists.
- Request validation using the status report.
After releasing new templates or updating your code
When you make significant changes to your website, monitor for increases in structured data errors and warnings.- If you see an increase in errors, perhaps you rolled out a new template that doesn't work, or your site interacts with the existing template in a new and bad way.
- If you see a decrease in valid items (not matched by an increase in errors), perhaps you are no longer embedding structured data in your pages. Use the URL Inspection tool to learn what is causing the issue.
Analyzing traffic periodically
Analyze your Google Search traffic using the Performance Report. The data will show you how often your page appears as a rich result in Search, how often users click on it and what is the average position you appear on search results. You can also automatically pull these results with the Search Console API.Troubleshooting
If you're having trouble implementing structured data, here are some resources that may help you.
- You might have an error in your structured data. Check the list of structured data errors.
- Troubleshoot missing rich results / drop in total rich results.
- For general questions about crawling and indexing, check the Google Search crawling and indexing FAQ.
- Ask a question in the Google Search Central office hours.
- Post a question in the Google Search Central forum.