Title: Using Aggregate Rating Schema
Last modified: March 7, 2021

---

# Using Aggregate Rating Schema

 *  Resolved [Bakhshi](https://wordpress.org/support/users/bakhshi/)
 * (@bakhshi)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/using-aggregate-rating-schema/)
 * Hello
 *     ```
       add_filter('wpdiscuz_rating_schema', function ( $rating_schema, $key, $postid ){
           $my_rating_schema = 'Book';
           $rating_schema = str_replace(__('Article Rating', 'wpdiscuz'), $my_rating_schema . ' Rating', $rating_schema);
           return preg_replace( '|schema\.org\/Product|i', 'schema.org/' . sanitize_text_field($my_rating_schema) , $rating_schema);
       },11, 3);
       ```
   
 *     ```
       add_filter('wpdiscuz_rating_schema', function ( $rating_schema, $key, $postid ){
           $my_rating_schema = 'SoftwareApplication';
           $rating_schema = str_replace(__('Article Rating', 'wpdiscuz'), $my_rating_schema . ' Rating', $rating_schema);
           return preg_replace( '|schema\.org\/Product|i', 'schema.org/' . sanitize_text_field($my_rating_schema) , $rating_schema);
       },11, 3);
       ```
   
 * I am going to use both of them, I mean:
    I am going to put some page as “books”,
   and other as “SoftwareApplication”. what should I do?
 * Thanks in advance.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fusing-aggregate-rating-schema%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [gVectors Support](https://wordpress.org/support/users/gvectorssupport/)
 * (@gvectorssupport)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/using-aggregate-rating-schema/#post-14154955)
 * [@bakhshi](https://wordpress.org/support/users/bakhshi/),
 * You should use the if condition and add each hook-codes for post certain types/
   IDs.
 *  Thread Starter [Bakhshi](https://wordpress.org/support/users/bakhshi/)
 * (@bakhshi)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/using-aggregate-rating-schema/#post-14156488)
 * Sorry!
 * I do not know, how to wright the if condition for each IDs.
 * Could you advise me more?!
 *  Plugin Support [gVectors Support](https://wordpress.org/support/users/gvectorssupport/)
 * (@gvectorssupport)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/using-aggregate-rating-schema/#post-14161381)
 * [@bakhshi](https://wordpress.org/support/users/bakhshi/),
 * We’re really sorry, but there is no an easy solution we can post here. You should
   find some developer and ask to do this custom work for you.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Using Aggregate Rating Schema’ is closed to new replies.

 * ![](https://ps.w.org/wpdiscuz/assets/icon-256x256.png?rev=1076265)
 * [Comments - wpDiscuz](https://wordpress.org/plugins/wpdiscuz/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpdiscuz/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpdiscuz/)
 * [Active Topics](https://wordpress.org/support/plugin/wpdiscuz/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpdiscuz/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpdiscuz/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [gVectors Support](https://wordpress.org/support/users/gvectorssupport/)
 * Last activity: [5 years, 3 months ago](https://wordpress.org/support/topic/using-aggregate-rating-schema/#post-14161381)
 * Status: resolved