Yasr basics shortcodes

Overall Rating

Overall Rating shortcode is read only and is used by the reviewer.
It’s available in 3 different sizes: “Small”, “Medium” or “Large” (here you can see the large one).
In the settings, you can customize the text shown before or after.

You can manually place the shortcode where you need, or use the auto insert feature, see the video tutorial here.


How to use it?

To insert the rating in this widget, thare are two ways:

If you're using the Classic editor, simply give a rating in the YASR metabox that appear at the top right of the screen while you're writing a new post or page.
If you're using the new Gutenberg editor, click on the "+" icon to add a block, search for YASR and select YASR: Overall Rating. A new panel will appear to the right: you can add your rating here.

Visitor Votes

What do you think about this?
[Total: 4867 Average: 4.1]

This is Visitor Votes. With it you can:

– Choose to allow anonymous or logged in only users.
– Logged in users can update their vote anytime.
– Size can be “Small”, “Medium” or “Large”.
– You can customize the text shown before or after.
– Hover on the chart bar icon to see the stats.

Feel free to use it here.

How to use it?

You can paste the shortcode yasr_visitor_votes where you need to show the widget, or you can use the auto insert feature as explained in this tutorial. If you're using the new Gutenberg editor, click on the "+" icon to add a block, search for YASR and select YASR: Visitor Votes.


Visitor Votes Read Only

In some cases you may need to show an average of your visitor’s votes, but without allowing them to rate it (e.g. in a category page).

In this case, just add the readonly=”yes” parameter to yasr_visitor_votes shortcode.


What if you want show ratings from another post or page?

All these shortcodes can be used along with the postid parameter. So,if you wish to show a rating from another post or page you can just use the postid, e.g. yasr_overall_rating size="medium" postid="XXXX"

Leave a Reply

Your email address will not be published. Required fields are marked *

130 thoughts on “Yasr basics shortcode

  1. Hello, is it possible to add a feature to your plugin to avoid self rating?

    We have purchased your plugin but my client don’t want users to rate his own post. How much/how long will it be if it is possible?


  2. Hi,
    I love this plugin, working like a charm without messing up other plugins. Only 1 thing if i cloud do that would be awesome, if i could change the color of the stars from yellow to red. My theme color is red. Can i change yellow starts to red starts in free version?

    1. Hello Daniel!

      In free vesions thare are 3 different stars styles to choose, but there is no one red.
      In that case you’ve to go to pro version (you can test it using the trial, it is the second one)


  3. Hello,

    I need to change column width on ranking. We have inserted two columns ranking shortcode on a text box with 1600px width, but table is narrower than the box, os we want to make first column wider. How can we do that?

    You can check it here using user support and pass EDIT



    1. Hello,

      These are the classes used by that ranking:

      yasr-table-chart AND yasr-pro-most-highest-table are the containers

      yasr-top-10-most-highest-left is the class for the left column, defualt width is 50%

      yasr-top-10-most-highest-right is the class for the right column, default with is 50%

      I see you’ve already changed the width in your page, left is 75%, maybe I read this comment later your customizations?

      1. You can use auto insert feature only for yasr_visitor_votes and yasr_overall_rating shortcode.

        If you need to auto insert something else, you can insert the shortcode in a child theme

  4. Amazing plugin, thanks!
    Is there a way to disable YASR Rich Snipped except stars? That way i could use another rich snipped plugin like Rank Math, which has more fields available.

    1. Hello Samuel!

      You’ve to use this hook yasr_filter_existing_schema to filter yasr existing rich snippets, but some coding skills are needed. You can also write me to dario AT yetanotherstarsrating DOT com, I can do this as custom work.


  5. Hi Dario

    Is it possible to auto insert at the end of the “Short Description” instead of the “Product Description”? Would save me entering many shortcodes a product at a time. Cheers!

    1. Hi!

      Not sure what you mean for short description and product description (I guess you’re using woocommerce? ) but you can insert the shortcode directly in your template with do_shortcode function.


      1. Hi Dario, Thanks for your reply. I have successfully inserted the shortcode into my theme functions which seems to have solved my problem. The issue I have now is that my aggregateRating is not being generated in the source. I Have looked for the option in General settings to select this as the rich snippet type but it is not there? Google’s Cache shows the stars but they aren’t in the search results. I must be missing something as a lot of Schema data is already being produced but not the AggregateRating. Thanks in advance

  6. Hello,

    I’m looking for a post rating plugin and I it seems YASR fits what I need. Just a few questions:

    – We want rating to be displayed on post list on blog page.
    – We need to create a ranking with a list of top rated posts sorted by score displaying on top the best (more stars) post.


      1. I’ve used yasr_pro_visitor_votes_chart shortcode but no posts are displayed. I only get the message “not enough data to display” (in spanish, so I don’t know the message in english). We have 10 rated posts, what am I doing wrong?


        1. Sorry, I see it has to be rated twice to be on the list. Is there anyway (other shortcode, pro version, etc) posts with only one rating appears there?


          1. This is possible in the pro version, selecting “1” to Number of minimum votes for most rated page and Number of minimum votes for highest rated page

            1. Hi!

              Now I’ve purchased pro version but I don’t know how to do that. Is that adding shortcode properties?


  7. Hi…The plugin is working fine. I don’t want to show the total number of votes and average count to anyone (both logged in and not logged in). How can i achieve that ?

    1. Hello!

      Go to the settings -> Aspect & Styles -> Custom CSS Styles and add this code

      display: none;


  8. Hi. I’m trying your plugin and looks good. The thing is I have pages fo courses and sales pages that are done with the profit builder sistem. Tehn I saw that the rating plugin don’t appear in that pages. Could appear if I insert a code html. Can you help me? Other thing is I would like to insert the html of the plugin so my students can rate the classes and that rating could appear on the sales page. Is possible to do with your plugin? Thanks very much

    1. Hi, I can’t test with that plugin since is a paid one: you’ve to insert the YASR shortcode as a simple text, just like this



  9. Great plugin!
    I still have a question:
    Is there a way to order posts in the archive page by visitor votes? I haven’t managed to find the meta value name of the visitor votes, just the overall rating.

    1. Hello!

      The visitor votes are stored 1 by 1 in the yasr_log table, to calculate the average of the single post the function YasrDatabaseRatings::getVisitorVotes($post_id) is used.


  10. Hi. I checked out the plugin. Nice one. But what I don’t get is (in the free version) how to show at the top of an article how the average voting was. Before I used a plugin that allows this details (but it did not support structured data).

  11. Hello, I’m using the Visitor Votes Read Only shortcode in post excerpts. It was working before, but at some point the “readonly” code has stopped working. If I include readonly=”yes” the stars no longer appear. If I remove that part of the shortcode, the stars do appear, but are now clickable. I’m using this: [yasr_visitor_votes size="medium" postid="XXXX" readonly="yes"] Thanks for your assistance.

  12. Ciao, ti ho contattato dal tuo sito personale e mi sono accorto subito dopo dell’avviso che non potevo chiedere info circa il plugin. In ogni modo scrivo anche quì la mia perplessità. Il plugin YASR permette di votare tranquillamente ma noto che non è possibile rivotare lo stesso articolo subito dopo. C’è qualche regola che vincola la votazione nella versione free? Oppure lo stesso utente può rivotare lo stesso articolo dopo un preciso lasso di tempo? Grazie in anticipo

    Hi, I contacted you from your personal site and I realized immediately after the notice that I could not ask for info about the plugin. Anyway I also write here my perplexity. The YASR plugin allows you to vote quietly but I know that it is not possible to vote the same article immediately after. Is there any rule that constrains the vote in the free version? Or can the same user revoke the same article after a specific period of time? Thanks in advance

    1. Hi,
      Allowing the same person to vote the same article it’s a non sense; that’s why a cookie is set after the a rating is saved.


  13. Dario, I have another question. I need to show the star at the same line with the text.
    Example: Here is my text ***** and the text after stars.
    But I have like this:
    Here is my text
    and the text after stars.

    I coud not to find where to change css.
    Thank you.

    1. If you’re using yasr_visitor_votes, the css class to use is yasr-visitor-votes; if you can provide me a link I can help you better with this.


  14. I want to change this default text =>
    “You’ve already voted this article with 4.0”

    Mine is not article, so I want to put specific word in that. Is there any attribute for shortcode to use custom text?

    1. Hello!

      You can do this in Yasr Settings -> Insert custom text to show before / after stars -> Custom text to display AFTER Visitor Rating


  15. Hello. Thanks a lot for the plugin. I need to have several ratings at the same page. And all of them must be clecable. In this case I am using shortcode [yasr_visitor_votes size="small" postid="1966"] . And it works well. I just want to find out how to make them not clicable for certain post after the voting for that post. Stars remaining clecable and guests can vote for the same post million times. I have allready tryed to use IP function but no result. How to solve it?
    Thank you Dario.

    1. Hello John!

      A cookie is set when an user rate for a certain post or page (based on postid)
      There is no check on the IP, because many different users can use the same IP.
      That funcion only save the IP (but is not GDPR compilant)

      If your browser doesn’t accept the cookies, you can rate any time you want.


  16. Hello,

    I’m interested in buying the Yasr Pro Lifetime Plan. Do you have an email address where I could send some pre sale questions?

    Thank you very much in advance.

    Best regards,

  17. Hello, first of all, thanks for your wonderful plugin.
    For now we don’t need the pro as we have very small website so it doesn’t make any sense to spend that amount of money for just 1 thing we need: change the color of the stars of the voting into red.

    We tried anything with CSS but couldn’t find any solution. How can we achieve that?

    Thanks a lot for any suggestion
    Kind regards

  18. Hey,
    I noticed that aggregateRating is missing in the JSon-LD
    Also no matter what I select (product, moive, etc) only BlogPosting is added (if that’s important for getting the visitor ratings shown in google at all)

    Don’t know if I did anything wrong? But really tried every setting. Although I really like YASR as my favorite plugin, I gave up and installed another one in order to get the rating shown in google again 🙁 So if its a bug or something, it would be great if you could fix that with the next update and I’ll be back 🙂


    1. Sorry, comment edited; I just quoted the wrong one:

      If you need aggregateRating, I guess you’re using yasr_visitor_votes shortcode, that’s correct?

      Do you have a link to the site?

  19. Hello Dario,
    See if you can help me, today I have the standard woocommerce ratings, (native) I installed the YET plugin, enabled it, but it does not have any existing rating, the stars are all gray, there is some way to make it read Does this information already exist and appear on the screen?

  20. Hello,
    Is it possible to add next to Overall Rating Stars also a number that I rated?
    For example, if I give 4.7 stars, that “4.7” is next to stars in post?
    Thank you very much.

    1. Hi!

      Yes, it is!

      In the Yasr Settings, enable “Insert custom text to show before / after stars” and in the first field, insert this %overall_rating%


  21. Hi there

    I have a writer’s website where writers post there writing and get reviews from other writers/members. I’d like to know how I can show the rating next to or above each review so that the post author knows how many stars were given for their work and by which reviewer.


      1. Sorry for the delay, I haven’t be able to work this week.

        I’m not sure about your problem: where exactly you want to show the rating?
        Can you provide a link?

      2. Hi

        I just need the stars to appear next to or under the name of each and every review. Exactly as it appears on WordPress.org where I left the 5-star review last time a few weeks ago.

        Thanks for your help and your email

            1. Yes, the first review that you see, in that post, (written by me) with the stars attached to the individual review. You’ll notice that the reviews underneath don’t have ratings/stars attached to them. With yasr I only got the average/total ratings. What I need is the average/total plus the rating from each reviewer.

            2. For example…

              What we get now is…

              Total/average *****

              Comment by Walu Feral

              Very nice poem.

              What I need is…

              Total/average *****

              Comment by Walu Feral
              Very nice poem.

              Hope that makes it more clear.

  22. Hello,
    I would like to insert the YASR plugin into my site via the HTML code because I can not use the shortcode here.

    What are the lines of code to insert please?
    I can not find the information anywhere.

    Thank you !

  23. Hi! Great plugin. I tried to access the FAQ and the tutorials pages, but both seems to load and don’t show any content. So I have two questions:
    1 – Can I show the number of total votes from a specific category in a custom post type? We use your plugin last year with same configuration, but only for a month. But now they want to show the total number of votes in the front page.
    2 – Can I show more than 30 rows in “Overall Rating Ranking” shortcode?

    1. Hello!

      Thank you, I’ve fixed that pages!

      1) I guess near yasr_visitor_votes ?
      No, but I can do this as a custom work.

      2) Just like ansert 1.


      1. After the upgrade, I can’t use YASR PRO. My website show the message “My site is experiencing a technical problem”. So I deactivated the PRO version and Im using the free version for now. What can I do? Could you help me, please?

  24. Hi Dario,

    That seems to be a great plugin ! Unfortunately it doesn’t work for me after 2 hours testing.
    I am working with Elementor Pro, maybe it is the cause of the issue…

    1. For checking purpose, when I try to click on a star as a guest, there is not possibility to do so… The click doesn’t seem to work…
    I inserted the shortcode via Elementors widget, tried also with the text editor widget, as well as gutenberg shortcode widget. any of the 3 work well.
    2. I would also like to center the stars in the middle of the page. So I added a custom Css in the plugin styling section.
    .yasr_table_multi_set_shortcode tr td {

    text-align: center;


    It didn’t work. So I tried also in Elementor custom css section for the widget and it didn’t work either.

  25. *Shortcodes*

    Can you please create a page with all of your shortcodes laid out one after the other clearly? As a new customer, I find this page almost impossible to understand, sorry.

    For example, what is the shortcode for “Visitor Votes Read Only”? Can you please reply with the exact shortcode? I have tried following your instructions, but they are vague.

    The tutorials page is also not working: https://yetanotherstarsrating.com/tutorials/

    Thanks for your help,

    1. Hi Ryan.

      A page with all the shortcodes is in progress.

      Keep in mind that you don’t need to know all the shortcodes: if you’re using the classic editor, just click on the star above the textarea, you can build your shortcode there.
      If you’re using gutenberg, just add the block.

      To answer your question, just use this [ yasr_visitor_votes_readonly ] OR [yasr_visitor_votes readonly=true ]. Both will works.


  26. Hello! Add a shortcode ”yasr_visitor_votes” to my slides Everything is fine on a PC, but it hangs on the phone. Even on an emulator in chrome hangs. Help!)
    “yasr-front.js?ver=2.0.3:213 Uncaught TypeError: Cannot read property ‘toFixed’ of undefined
    at Object.rateCallback (yasr-front.js?ver=2.0.3:213)
    at Object.onStarClick (rater-js.js?ver=2.0.3:150)”

          1. It seems that such an error only occurs inside Smart Slider 3. I was hoping that a message from the console would tell you.
            “yasr-front.js?ver=2.0.3:213 Uncaught TypeError: Cannot read property ‘toFixed’ of undefined
            at Object.rateCallback (yasr-front.js?ver=2.0.3:213)
            at Object.onStarClick (rater-js.js?ver=2.0.3:150)”
            Anyway, thanks for the help. You made a good plugin!)

  27. Hi, i can not find where to input the author rating or the + sign to add the meta box. Im using the latest version of wordpress.

  28. Hi there

    I like the plugin but, the stars and text appear right below the end of the post… almost like the text “Click on a star to give a rating,” is part of the poem or story. Is there a way I can move it down the page about an inch or so? So that it looks separate the posting?

    1. Hi!

      Of course is possible 🙂

      In the Yasr Settings, open the tab “Aspect and Style” and in the “Custom CSS Styles” textarea add this code:
      .yasr-visitor-votes {
      margin-top: 20px;

      Change 20 with the value that you need.


  29. I want to rate By author but I would like to add one more star

    it it posssible to change from 5 stars to 6 stars rating ?

    Do You stay in Italy ?

  30. Hi,
    is it possible to show the statistics of a review on a new line/paragraph (&nsbp) ? Currently it shows directly after the stars, I think it would look nicer on a new line.
    Is it also possible to load the rating of a post as a custom field or with a shortcode?

      1. Ok, grazie mille! 🙂 Altra domanda.. come mai su alcuni articoli mi da la possibilità di votare e su altre invece no?

      1. Hi There.
        This shortcode works on the single pages but its not working on Category pages (for example product category page in woocommerce) . why is that?

          1. Hi again.
            I finally managed to put the rating star into Archive page with shortcode.
            the tiny problem is, its showing the stars with Big font size, although I chose the Medium size.
            How can I change the size of stars with CSS??

    1. Hi, of course!

      Just add the shortcode [yasr_visitor_votes] where you want to make appear the star set 🙂


  31. Hi. Nice plugin .. Just a quick question .. is there any way to add it by shortcode? I mean in my web i want to use in the homepage as well … but it shows on the left side down on the footer and makes the design ugly … Any idea? Best Regards

  32. Can a shortcode start inline with a previous text or have text after? I have a two ranking system, and want to put the stars before or after the previous 100-point system. But it always goes to the next line, no matter how I edit the HTML.

    1. Hi Pablo, of course is possible 😉

      You can do it by placing the shortcode manually or even when auto insert is enabled.