Adding star rating on rankmath schema dynamically

#42486
  • Resolved Maneesh Ashuthosh
    Rank Math free

    I wanted to add rankmath schema (software application) to my website. However as far as I know it only allows me to put in a static value. Is there any way I can update this value dynamically?

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math today.

    You can override the rating value displayed on the schema by hooking into the following developer filter on your theme’s functions.php file:

    /**
     * Filter to Short-circuit Schema if a 3rd party is interested in generating their own data.
     * Replace $schema_type with schema name like article, review, etc.
     * @param array $entity Snippet Data
     * @return array
     */
    add_filter( "rank_math/snippet/rich_snippet_{$schema_type}", function( $entity ) {
    	return $entity;
    });

    I hope this info helps. Thank you.

    Looking forward to helping you. Thank you.

    ​​​​​​

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Adding star rating on rankmath schema dynamically’ is closed to new replies.