We recently looked for a way to integrate a simple post rating system into WordPress. And we found out that the best way to do this was through the plugin WP-PostRatings, developped by Lester 'GaMerZ' Chan.

In this tutorial, we'll show you how to set up an AJAX rating system for your WordPress posts and pages.

You must first download and activate the plugin WP-PostRatingsAfter activation, the plugin will add a new menu item in your WordPress admin bar called "Ratings". We will skip the option "Manage Ratings", and start with the second link in the tab called "Ratings Options".

Ratngs WordPress Plugin Options Note System

On the plugin's settings page, you first need to choose the review logo you want to use for your posts. The plugin offers a number of options like bars, heart, numbers, plus-minus, classic stars, thumbs up / down, arrows up / down, etc.

Once you have chosen the scoring system you want to use, you can define the " maximum scores". The plugin will choose an appropriate value for you; however if you are using the bar logo you may want to specify your own rating value. For stars and numbers, it seems pointless to go over 5 since there are only 5 stars.

Remember, if you adjust the maximum notes, you will need to adjust the individual notes. If you don't change the default maximum score, also let individual reviews be managed by default.

Then you will see options regarding AJAX style, review permissions, and connection methods.

WordPress plugin rating style of article evaluation

You can follow the style of the previous image for better results. However, if you want to customize, you might need to change it. We are done with this page, you can save the changes.

Let's go to page « Rating templates ». On this page, you will find different templates notation and the ways you can organize them. This is basically to show how your ratings will be displayed. Once you are finished with this page of templates, you are ready to add it into your theme.

Depending on how your theme is configured, you will need to add the codes below in the following files: archives.php, page.php, index.php, single.php, loop.php etc. (You might not have all of these files in your theme depending on the structure).


Note, this will add the post rating to all posts. If you just want to use it on the selected posts, you can use the shortcode [ratings id = "1" results = "true"].

Now that the ratings are added, your users will vote on your posts. You can see these notes at the option level "Manage Ratings" that we skipped initially. She offers you a journal of notes on each post, and you can just as easily delete them if you feel something wrong.

The best option of this plugin is that it gives the possibility to display the highest rated posts (with time intervals and category), the most noted (with time intervals and category), the worst and the best rating with the same option of time intervals and category.

Most of the time, these types of statistics are added on the sidebar, but this plugin allows you to use widgets to display them (only if your theme is compatible with widgets). Just go on Appearence »Widgets and find the ratings widget. Drag it to the appropriate location and set the parameters you want.

Parameter widget for WordPress evaluation system

Now you notice that in the screenshot above there are quite a few options. The first is to select the title of your widget. It is better to choose a title like "This week's best rated publications" or something like that.

Field "Statistics Type" has tons of options that allow you to view top rated, most rated, worst rated and highest rated. You also have the option of setting these statistics by category or by time.

The next option asks if you want to include both your posts and pages. This is a personal choice, so decide how you want. The widget offers 10 of the most popular entries by default, but you can change this by changing the "No. of Records" to display.

We strongly recommend not to do more than 10, as it will not display correctly. You can also set the minimum number of votes an article needs to appear on this list. Depending on your site design, you may or may not want to adjust the maximum post title length. If your theme location is large enough, we recommend setting the value to 0 to disable.

If you are using category or time as the specific statistic type, you will need to edit the last two fields. Click and save, and you're done.

Now we know some of you are coding junkies and don't want to use widget settings. Ballast has compiled a very detailed user guide on its site that explains how to add top rated, top rated etc. directly in your WordPress themes. Refer to WP-PostRatings User Guide.

We hope this article has helped you add a post rating system to your WordPress site. If you have any comments or suggestions, please let us know in the dedicated section.