Support » Plugin: Schema »

  • Resolved nissimziv


    I would like to integrate + Question + Answers using Schema plugin.
    Is there a way making it happen?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Hesham Zebida


    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 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 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 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 markup output.

    I hope this help you get started.

    Thread Starter nissimziv


    Thank you,
    I am going to implement it.

    Plugin Author Hesham Zebida


    Great, good luck!

    Step 2 isn’t entirely clear. How do I change the default WebPages @type in my new QAPage type to “Question” (as per )?


    Plugin Author Hesham Zebida


    @docjohn You can override the output array. Something like this:

    add_filter('schema_output', 'schema_wp_extend_output_987345256');
     * Extend / Override Schema Output
     * @since 1.0
    function schema_wp_extend_output_987345256( $schema ) {
    	// Remove mainEntityOfPage
    	// Remove articleSection, since it will through an error
    	// Add mainEntity > Question
    	$schema['mainEntity']['@type'] = 'Question';
    	return $schema;

    I hope this helps.

    That definitely helps get me started. Thanks for the assistance!

    Plugin Author Hesham Zebida


    No problem.

    Thanks for this. Are you going to and this functionality to the plugin? Meaning…. So I can do it in a friendly GUI environment.

    Also. do you suggest a way to implement the speakable schema type? Is this something you planned on implementing?

    I don’t know whether it would be suitable here to name other plugins, but I solved the exactly same issue today with this plugin

    It supports QAPage schema type if your question-answer site is built with DW Question plugin.
    In fact, I was looking for this schema support for long and thought you would find it helpful. Thanks.

    Hello, I want to integrate + Questions + Answers using the plugin “Schema – All In One Schema Rich Snippets” Is there a way to make it happen? thank you

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘’ is closed to new replies.