To include the shortcode of kk Star Ratings plugin in your theme or CSS, you can make use of functions.php or style.css files.

One of the best wordpress star rating plugin to implement user rating structured data schema. kk-star-ratings that appear in Google Search results give a strong reason for users to click your article.

It is possible to display these ratings in WordPress using plugins as rich snippets.

Google shows visitor ratings in its search results.

Review rating plugins give authors of an article to leave an author review rating.

The aggregate rating is a good indication for a decent user experience. A high quality rating indicates the popularity of the page.

WordPress automatically and selectively uses kk star ratings plugin. In this post we are going to see how to include the kk star ratings shortcode at any place in a post and using PHP.

How to use kk Star Ratings shortcode in Custom pages and posts

Manually insert the short code at the required place. Totally disable the star rating for particular categories or pages.

Include this code in v3. Use square brackets for short code.

<kkstarratings force> or <kkratings force>

For each page or post, you can use this code. You can also use the following shortcode also.

<kkratings> and <kkstarratings>

To include the ratings in templates like single.php or footer.php, you can use the following code.

<?php if (function_exists('kk_star_ratings')) { echo kk_star_ratings(true); } ?>


<?php if (function_exists('kk_star_ratings')) { echo kk_star_ratings($postid); } ?>

The plugin’s rating widget is not just for show; it serves as a powerful content rating tool, allowing visitors to leave user ratings that reflect their opinions. Whether for blog articles or product pages, the article voting feature encourages users to engage more deeply with your content.

Moreover, kk Star Ratings supports comment ratings, enabling your community to rate each other’s contributions, thus adding another layer of interactivity and WordPress feedback. This feedback mechanism is invaluable for gauging the success of your content and for fostering a community atmosphere.

Incorporate kk Star Ratings into your site today and watch as it transforms a static page into a dynamic space for user interaction and engagement!

kk Star Ratings Features – Version 4.1.4

You can download this plugin and get further details. It is free to use.

1. Default user rating of 5.
2. User can give star ratings for posts or pages.
3. Amount of star ratings.
4. Structured data support.
5. The ratings are visible as google rich snippets.
6. It works with publicly accessible custom post types.
7. You can include your personal hooks for additional functionality.
8. Settings are available using the options page.
9. Globally disable/enable options page.
10. Disable star ratings on posts belonging to certain categories.
11. Star ratings on homepage, archives, posts, pages and in custom post types.
12. Control the structured data schema and type.
13. Restrict user voting per unique IP.
14. Allow guests to vote
15. Adjust the color of stars.
16. Adjust the number and amount of stars.

Related Post :   How much can Picture Compressor act as Image Size Reducer - Our Study and Results

The main advantage of using this plugin is its rich snippets feature possible through structured data. As a visitor leaves his rating on the article, it should be visible in Google. The average of the collective visitor rating in Google SERPs.

kk Star Ratings Review of Features

kk Star Ratings Settings

When you update to the new version, it will ask you to subscribe to a security notification page using a service. It is not mandatory and you can skip that option if you are not particular about using it.

It has the following main 3 tabs.

1. General
2. Appearance
3. Rich Snippets


Status –

  • Active – Check this to globally activate the star ratings. If you uncheck it, it will deactivate in the same fashion.

Strategies –

  • Allow voting in archives
  • Allow guests to vote
  • Unique votes (based on IP address)

Manual Control

  • Posts
  • Pages

Once you check any of the above options, you will have manual control to embed the star ratings. This can be done using the hook echo kk_star_ratings(); which can be controlled by the theme or template.

kk star ratings short code manual control

Disable Locations

  • Home page
  • Archives
  • Posts
  • Pages

Disable Categories

You can enter the categories to exclude star ratings. The posts belonging to these categories will not display the ratings.

Default Position

  • Top Left
  • … Center
  • Top Right
  • Bottom Left
  • … Center
  • Bottom Right
kk star ratings position

Rich Snippets

  • Using the status option you can activate/deactivate rich snippets.
  • You also need to provide Structured data Context and Type.
kk star ratings code rich snippets


In this tab, you can decide the following.

  • Greeting text
  • Stars
  • Gap
  • Size
kk star ratings plugin appearance

kk Star Ratings Changelog – 4.x, 3.x


– Bottom margin added when bottom position in effect.
– Ability to reset ratings for individual posts/pages.
– Enable/disable star ratings for individual posts/pages.
– Take manual control of the auto embedded markup to avoid duplication when using in a template.
– Optionally allow guests to vote.
– Ratings can also be included in publicly accessible custom posts.

  • Customizable gap/gutter between stars.
  • Structured data in pages.


– Google rich snippets.
– AJAX call on every load causing high CPU usage.
– Markup is now hidden under AMP.
– Assets are now enqueued when manually/forcefully loading the markup via template function.

  • Unique voting now correctly forbids multiple ratings by same IP. (GitHub PR #91).
  • Options are now correctly synced when installing, upgrading and activating.
  • Use absolute change log links in docs.
  • Special characters are now escaped in the title of structured data.
  • Factory/default options are now synced on activation.
  • Activation only ports the previous options if version was lower than 3.
  • Relative star svg links instead of absolute links are now used in css.
Related Post :   Top 5 Epic Benefits of Hummingbird Plugin - Asset Optimization and Cache, GZIP Compression, Speed


– Default colors have been updated.
– Default size is now 22px instead of 24px.
– Structured data now uses ratingCount instead of reviewCount.
– Stars are now based on svg.
– Appearance has been simplified.
– Html based structured data has been replaced by json based structured data.
– kk_star_ratings_get function no longer includes the post_title key.

  • It has an active user base of 80,000+ installations.
  • Works with WordPress version 5.5.3
  • It works on PHP version of 5.6 and above.
As of 6th Dec, 2020 a good amount of 159 users have given rating to this plugin. Out of this 101 have given 5 star rating. This means that 70% of the users have given a strong rating to this plugin. Only 10% voters have given 1 star rating.

kk Star Ratings Problems

As we know some of the plugins make AJAX calls to the server in WordPress. This was the case in ver 2.X. As I was using the old version of this plugin, I faced the same difficulties.

The plugin was making admin-ajax.php call which caused server loading with high CPU usage time and caching optimization was not at best.

When I tested the page speed using GTMetrix with version 2.6.4, the culprit was kk Star Ratings plugin. It was making an AJAX call which took about 578ms for loading.

kk star rating ver 2.6.4 admin ajax call problem

The fully loaded time of the page was only 1.7s with a total page size of 1.54MB and 40 requests. The GTMetrix test gave the following results.

I got D (62%) in PageSpeed Score and A(92%) in YSlow Score.

pagespeed score gtmetrix using kk star rating plugin 600x222 1

The following plugins were being used –

Active Plugins: Accelerated Mobile Pages, Akismet Anti-Spam, Classic Editor, Lightweight Subscribe To Comments, Contextual Related Posts, Cookie Notice, Easy Table of Contents, EWWW Image Optimizer, Inline Related Posts, kk Star Ratings, Link Juice Keeper, PageSpeed Ninja, Redirection, Schema, TablePress, Thin Out Revisions, Wordfence Security, Yoast SEO, WP Mail SMTP

I was using Thesis Framework with Effectus Skin.

Performance Testing using kk Star Ratings ver 3.1.1

Though there were several plugins which required update, I only updated the kk Star Ratings plugin to ver 3.1.1.

I then cleared my Cloudflare and browser cache.

I tested the same page using GTMetrix again couple of times. In my test case I found that the AJAX call has reduced to 409ms. But the PageSpeed Score did not improve. Also the fully loaded time was now 1.9s.

So I decided to update the Thesis framework and other plugins. Purging of cache process was repeated. But still the admin-ajax.php call was taking more than 450ms.

kk Star Ratings Review of Performance results in ver 3.1.1

So I decided to test another site where kk Star Ratings was installed.

It had only 2 posts and had the same older version of 2.6.4 like the previous one. I tested with that version first. This result also showed that the admin-ajax.php call was taking more than 600 ms.

Related Post :   Settings Review of WP Rocket (2023)

So I updated the kk Star Rating plugin to ver 3.1.1 and checked the results again. But the AJAX call still persisted.

As per ver 3.0.0 changes, this issue was resolved. But GTMetrix for both of my sites show that the problem still exists. I checked with Pingdom Tools. But it does not report the AJAX call. So it is difficult to ascertain whether the problem has vanished or not.

How to use kk Star Ratings plugin in AMP pages

Though the author of the plugin disabled this plugin in AMP pages, you can still enable it by applying some changes to the code. You can use the AMP for WP plugin to create AMP pages for your site.

In that plugin there is an option to input the CSS under Setting\Design\Global.

Copy the CSS of kk Star rating plugin from public\css\kk-star-ratings.css to the AMP location mentioned above. This should display the ratings in AMP pages also.

Feature Improvements requested in kk Star Ratings

Some of the users on the plugin support page have requested additional features to be integrated into this pluigin. These include –

  1. Disable Star Ratings on some Pages like Privacy, Disclaimer etc.
  2. Improve security by reducing the calls to admin-ajax.php.
  3. Adding IP logs to block fake ratings
  4. Removal of fake ratings
  5. Facility to revert back to old design of ver 2.x.
  6. Add kk-star-ratings.css/js to DOM style or include in inline footer
  7. Improve performance of the plugin
  8. Copy the plugin style CSS and paste manually in WordPress themes style.min.css and bundle.js
  9. Integration of ratings in WooCommerce archive and product pages.
kk star ratings support

Problems with kk Star Rating plugin

When users upgraded to the new version of 3.x, some of them faced issues.

1. When you downgrade the plugin from ver 3 to 2, some of them have seen an error log with message like this.

PHP Warning: in_array() expects parameter 2 to be array, boolean given in /public_html/wp-content/plugins/kk-star-ratings/index.php on line 525

The problem seem to be caused by index.php on the same line.

2. After update to 3.1.1 stars are not showing on posts and pages. The rich snippet feature is also not working for some sites.

3. The display of rating value and count is totally cluttered on some sites.

4. The star ratings on AMP pages are ugly to see. In the old version, there was no problem. But in ver 3.1.1, the star ratings are completely hidden in AMP pages.

5. There is incompatibility with some cache plugins. It conflicts with W3TC plugin from version 3.0.1 to 3.0.5. People resorted to using ver 2.6.4 to circumvent this problem.


  1. hi,
    this is Eskander,
    i already use your kk rating plugin,
    i need top revew post for query arugments,
    so what can i show my sites in top revew post?

    1. Palla Sridhar says:

      @eskander. Thanks for the comment. This is not a support site. You can go to the plugin page in WordPress repository and post your support question. The kk star ratings plugin development team may help. 🙂

  2. Hi
    Can i use kk rating shortcode in the elementor?

    1. Palla Sridhar says:

      It is like any other shortcode. If you have problem, check-in with their support.

  3. kk plugin Star Rating showing in the post but not showing in google How to fix this issue?

    1. Palla Sridhar says:

      @kaushal. That entirely depends on Google. BTW, you need to add some Schema to the kkstar code. I will update the article.

Leave a Reply

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