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: 3948 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 *

55 thoughts on “Yasr basics shortcode

    1. Hi!

      < ?php echo do_shortcode('[yasr_visitor_ratings'); ?>

      Or whatever your shorcode is.

      Please note that this works only on template files

  1. 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 !

    1. Hi!

      < ?php echo do_shortcode('[yasr_visitor_ratings'); ?>

      Or whatever your shorcode is.

      Please note that this works only on template files

  2. 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?

  3. 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.

  4. *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.


  5. 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!)

  6. 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.

  7. 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.


  8. 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 ?

  9. 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 πŸ™‚


  10. 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

  11. 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.