PHPMatters Help You Better Hosting Your PHP-based Sites
How to Add WordPress Post Rating System

How to Add WordPress Post Rating System

Collecting the feedbacks from readers about your posts is an important practice to improve your article quality and the reading experiences. After all, you are writing for your visitors, so it is necessary to figure out whether they prefer your writing styles and whether they are interested in your topics.

Initially, you may get these feedbacks from your comment section or through the social media platforms. Now, you can make use of the WordPress post rating system, with which you can easily know which kinds of your blog posts are popular among your readers and tailor your content accordingly.

Add WordPress Post Rating System

The easiest way for adding such a great system is to utilize the WP-Post Ratings plugin. With it, you can set up an AJAX rating system for both of your blog posts or webpages, as well as showcasing the highest rated posts in your sidebar. Upon the successful installation and activation of this plugin, you can go through the following steps for better plugin configurations.

Step 1 – Add the Required Coding Stuff to Your Theme File

Before starting the configurations, you should firstly place a small piece of coding stuff into your theme file, which tells the plugin the exact location for showing the star rating widget.

To do this, you can enter your WordPress dashboard and click the Editor button from the Appearance drop-down menu. In the right-hand column, you can find the “loop-single.php file”. Edit it based on the highlighted part showcased in the below screenshot.

Post Rating Code

Now, you can have the rating widget showcased at the top area of your blog posts, right before the post titles. Also, you can change the position based on your needs by moving this line of code within the loop file.

It is possible that your current theme does not have this special theme file depending on the template design and structure. In this case, you can also add the code into the files of archive.php, index.php, single.php or page.php within the loop section.

Here, you have to note that the above-mentioned code is used to showcase the ratings on all of your posts/pages. If you only want to embed the rating system for some specific webpages, do not use the code introduced above, but just need to enter [ratings] into your selected pages.

Step 2 – Configure Post Ratings Option

After installing the WP-Post Ratings plugin successfully, you can find a new tab named as Ratings from your WordPress administrative panel. From its drop-down, you need to click the Ratings Options button for plugin configurations.

Rating Settings

First of all, you should pick the rating image you like. By default, this plugin offers you 14 options to choose, among which the stars, stars_dark and stars_crystal are the most widely used ones.

Rating Image

Secondly, you need to decide the max ratings. In fact, the value can be decided automatically after you choosing the rating image. For instance, the max rating for star image is 5, for heart image is 1 and for thumb image is 2. Therefore, unless you have some special requirements, simply leave this option unchanged.

Lastly, you should decide whether to enable the Google Rich Snippets. This option really depends. If you can make sure that all your posts can be rated with a high rating, you surely should enable this function. Otherwise, you’d better think twice.

After all, the activation of this function means that people can check how your posts are rated by your readers from the search engine result pages directly. If the rating of your blog posts is low, they might be less likely to check your content.

Rating Text and Value

This option is exclusively for the star rating image, deciding its texts and values. Personally, we do not think it is necessary to make any changes.

Rating Text and Value

AJAX Style, Who Can Rate, How to Login

This plugin is powerful enough to add the AJAX styles to your rating system. For instance, you can decide to display the rating images with texts and showcase the fading in/fading out effects for your rating system. Here, we highly recommend you to turn on these two options.

Then, you can also determine who has the ability to rate your posts. Here, you can choose among registered users and guests, guests only and registered users only. We personally recommend you to choose the first option, which can reduce the intentional bad ratings from your competitors.

As for the logging method for the rating, you also have multiple choices, but we just suggest the method of “logged by cookie and IP”.

AJAX Style

Step 3 – Add the Rating Widget to Sidebar

This plugin allows you to showcase the most rated posts, the highest rated posts, the lowest rated posts, and posts gained the highest score in your sidebar. The special display even can be grouped based on content categories and time range.

For this, you only need to click the Appearance tab in your admin and hit the Widgets button. Among the available widgets, you need to choose the Ratings widget and drag it to your preferred widget area.

Then, you can decide the widget title, showcased types, number of records and many others options based on your ultimate preferences.

Rating Widget

It is done! Now, you have added such a great system successfully, and your readers can give the feedbacks of your blog posts and check your best posts with the highest rating easily.