There is a popular and useful WordPress plugin called kk Star Ratings that allow visitors to the website leave feedback in form of star rating. The usage of this plugin bring some benefit to the webmaster. First of all, the click rate in search result may be slightly higher because Google (perhaps other searach engines too) display star rating icons which encourage people to click. The second benefit is the feedback the website owner gets from visitors. If the rating is low, it is clearly a sign that there is something wrong with the post. If this happens, the editor should re-write the post and make it more valuable.
Tampering with these ratings is not a great idea and my intention is not to write instructions how to cheat 🙂 It is more how to protect your website against fake ratings posted by a hater or a competitor.
I have recently had exactly such a case. The ratings of one of articles on of my site smartpolak.co.uk were suddenly suspiciously low. I have checked Google Analytics and it turned out that while usually there are around 15-20 visits per day, there are some days with more 200 visits. During these days the ratings went really low. I know that the percentage of visitors that actually leave these rating is very low, probably around 1% if not less, so when suddenly I got 200 ratings in one day, I knew that something was wrong 😮
I suppose that some dodgy competitor found a way and visits my website to leave low ratings. I am not entirely sure how it is done, because kk Star Ratings has got build in mechanism to prevent leaving ratings from one IP address, but it is happening. I have contacted my host about it, and we may do further steps, but in the meantime I have changed ratings back to were they where before.
How to manipulate kk Star Ratings
There are a few things that we can do. If the problem is not serious and you are OK with losing existing ratings, the easiest way is to reset all the ratings back to zero. You can do it by visiting the plugin settings in the WordPress Dashboard. Click on the Reset tab, then click on the post or posts where you want to reset the ratings, and confirm by clicking Reset button.
If you do not want to reset the ratings and start from scratch, you can temper with it disabling unique voting, and then voting several times. Go again to plugin settings, click Unique voting section so it displays red x, then save the settings by clicking on Save button. Go to the post where you want to change the rating and cast several votes. Do not forget to go back to the settings and switching unique voting back on as this will prevent visitors to cast several votes.
How to quickly change kk Star Ratings
I didn’t use any of these methods because I did not want to lose all previous votes. Changing votes manually would also be time-consuming and not very effective. If I got 200 bad votes one day, I would probably have to vote over 1000 to revert this change. To change this information quickly, you need to access database, where kk Star Ratings stores information. There are a few different values there but basically the average ratings is calculated by dividing the ratings sum by the number of votes cast.
For instance, if there are 3 votes: 1 star, 2 stars and 5 stars, the average rating is 8 / 3 which is 2.66. You can easily change the rating by changing the number of votes cast. Let’s say we will chang it from 3 to 2. As a result you would get overall scorre 8 / divided by 2 equals 4 which much higher rating than 2.66.
OK, but how to do it? First you need to access the database. The information about the database and how to access it should be available in your hosting account. You can also have a look at the wp-config.php file that is located in the root of your wodpress site. This file also contains all the information about the database. I can access WordPress database via web application phpMyAdmin and will describe below specific steps. They should really be similar with other circumstances. In order to change kk Star Ratings you need to:
Log into phpMyAdmin with credentials from wp-confing.php file. You need to put 3 information: database username, password and the ip address of the server:
On the left-hand side you will see database name, click on the plus sign to reveal the tables. Find the table wp_postmeta (this wp_ part may be different if the database has been changed, in my case it is riwrk_) and click on it. You should see something similar to this:
Then, visit the post where you want to change the ratings and see the number of votes cast:
As you can see, in my case there was 289 votes cast and the overall rating is 4.1.
Next, go back to the tab with the database, click on the Search tab in the menu. A small window will be visible, in the meta_value row, put the namer of votes cast from the post and press Enter. Basically, you are trying to find the record of that particular rating.
If everything is OK, you should find the record. The meta_key should be _kksr_cas and contain the number of votes cast. All you have to do now is to lower it. Click on Edit link as indicated below:
You need to put lower number of votes cast. Do not go crazy, if the figure is too low, you may get more than 5 stars (or more than 10 stars if you use 10 stars for rating). Replace an old value with a new one and click Go button. For the purpose of this article, I will change 289 of votes cast to 275, and we will see what happens to the rating.
That is all. The rating should be different although that change may not be immediately visible if your website or web browser stores some data in cache. Try to refresh the page several times and see if ratings changed. You can also open the article in incognito mode.
If you are not happy with the new rating, you can change again. All you have to do is to find appropriate record using the new value and overwrite it again.
In my case the ratings increased from 4.1 to 4.3. Here are ratings before and after the change:
I hope this little trick will help you out. As mentioned, I do not recommend abusing it. If natural rating of your posts are low, this is a valuable indication that you should spend some more time on this article or even re-write it completely.