how to compatible custom star rating plugin with rank math

#87607
  • Resolved Mustafa Mirzaee
    Rank Math free

    Hi. I have made a custom plugin for my website. It’s a food blog ( Foodiemaryam – Under develop )
    I want to know how can I compatible my star rating with recipe schema of Rank Math. When people rates my recipe, agregateRating change.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Alberto
    Rank Math business

    Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    The easiest way would be to use the schema added by the star rating plugin and not set any rating in the recipe schema added by Rank Math, that way Google will use the rating provided by the other plugin.

    Looking forward to helping you. Thank you.

    ​​​​​​​

    No It’s not possible to me. Because I want the recipe star rating with the custom plugin. Not 2 different schema markup.

    Hello,

    You can use the following filter to to modify the schema data and assign the rating entity to the values you get from your custom plugin.

    
    /**
     * Filter to change the schema data.
     * Replace $schema with schema name like article, recipe, etc.
     * @param array $entity Snippet Data
     * @return array
     */
    add_filter( "rank_math/snippet/rich_snippet_{$schema}_entity", function( $entity ) {
     return $entity;
    });
    

    Hope that helps. If you have any further question(s), please let us know. 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 3 replies - 1 through 3 (of 3 total)

The ticket ‘how to compatible custom star rating plugin with rank math’ is closed to new replies.