This really depends on how your Q&A page or site is built, so there is no quick answer to that. However, it can be done with some coding. I will try to give you a hint!
The best way to do so -I think- is to extend schema.org markup via the schema_output
filter.
So, if you have Answers saved in post meta (or comments), you will be able to query those answers and append them to the markup output.
You will need to:
1- Add the new schema.org type, which will contain the Question, and list of answers to that question (you may want to use schema:Question
instead of schema:QAPage
):
add_filter( 'schema_wp_types', 'schema_wp_new_add_schema_type_762345655' );
/**
* Add support for schema:QAPage to Schema Types options
*
* @since 1.0
*/
function schema_wp_new_add_schema_type_762345655( $options ) {
$options['QAPage'] = array (
'label' => __('Q&A Page'),
'value' => 'QAPage'
);
return $options;
}
After implementing the code above, the new schema.org type will show in under Schema types in the Settings>Types meta box.
2- Create a new type and configure it within the Types section to work where your Questions are saved (example: the Q&A custom post type).
3- Create a sample page to test it out. Test the markup and see what’s missing.
4- Query data from your posts (post meta) and use it override properties in the schema.org markup output.
I hope this help you get started.