%count(varname)% Count the reviews

#50770
  • Resolved Andre
    Rank Math free

    Hello guys,

    I am trying to count the reviews in my SEO Meta Titel. I am using the plugin WP Reviews Pro too.

    The code is for the schema:
    },
    “aggregateRating”: {
    “@type”: “aggregateRating”,
    “ratingValue”: “5.21”,
    “bestRating”: 10,
    “ratingCount”: 3,
    “worstRating”: 0

    How do I set the variable “3” as a variable for this code: %count(varname)%. So that I can show how much ratings are done in the title. I hope you understand.

    Best regards

    Andre

    • This topic was modified 3 years, 11 months ago by Andre.
Viewing 13 replies - 1 through 13 (of 13 total)
  • Hello,

    Thank you for contacting Rank Math today.

    The rating count of each product is dynamic according to the number reviews and is usually save din the database. Allow me to consult the dev team if it is possible to access the value through a variable.

    Looking forward to helping you. Thank you.

    ​​​​​​

    Andre
    Rank Math free

    Thank you, please help me to show the rating number in Google Titel with %count(varname)%

    Hello,

    The count variable will return the number of times a variable is used on a page. To get the rating value from post meta, please use the %customfield(field-name)% variable and change the field-name to the meta key in which the rating value is stored.

    I hope that helps.

    Andre
    Rank Math free

    Thank you for your answer.
    What do you mean exactly with “Meta key”? Where I find this? I searched on google but got no solution.
    https://i.imgur.com/VQ9fQEP.jpg

    Alberto
    Rank Math business

    Hello,

    The meta key is the name of the entry in the database where is saved an information (in this case the rating value).

    In your case, I have installed the plugin and checked it for you and you should use the following one:
    %customfield(wp_review_user_reviews)%

    Looking forward to help you.

    Andre
    Rank Math free

    Hey, It shows a 0. This is not the right meta key I think.

    Best regards

    Andre

    Alberto
    Rank Math business

    Hello,

    I tested it in a local installation but maybe it was different in your case, so we might need to take a closer look at the settings. Please edit the first post on this ticket and include your WP logins in the designated Sensitive Data section.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    Andre
    Rank Math free

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Andre
    Rank Math free
    Alberto
    Rank Math business

    Hello,

    After testing it in your website I have found the solution (I think). I have left in the site a post in drafts where you can see it working.

    The var you should use is this one:
    %customfield(wp_review_comments_rating_value)%

    Looking forward to help you.

    Andre
    Rank Math free

    Thank you, sir, but I need how much users are rated the product^^. How many ratings are done? For this case “2”.
    In which data you are looking for the codes?
    Best regards

    Andre
    Rank Math free

    Thank you for your help. I found the right one:

    wp_review_comments_rating_count

    thank you

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    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 13 replies - 1 through 13 (of 13 total)

The ticket ‘%count(varname)% Count the reviews’ is closed to new replies.