How to Add a Simple Post Rating System in WordPress?

How to Add a Simple Post Rating System in WordPress?

Ratings and reviews are the systems that have become part of every website aiming to boost user engagement. WordPress doesn’t include a five-star rating system, but there are tons of plugins for adding this functionality.

The selected rating plugins are WP-PostRatings and Yasr, both of which are AJAX-based and in conjunction with WordPress comments. The post rating functionality can be added by customizing both the markup and the CSS, which is however beyond the scope of this tutorial.

How to Add a Post Rating System to WordPress?

The easiest way is using a WordPress plugin. The aforementioned plugins are available in WordPress repository, and you can install and activate them by following the prompts in “Plugins” > “Add New”. More plugin requirements and features are shown as follows:

Option 1 – Using WP-PostRatings

If you want an AJAX rating system for WordPress posts as well as custom post types, the WP-PostRatings is your choice. It’s developed by Lester Chan and includes the option of adding bar/heart/number rating system. There will be a “Ratings” menu in the admin bar, and let’s start with the “Rating option” tab.

Enter Rating Option

1. Post Ratings Options
Here, you will notice a number of “Ratings Image” ranging from “heart” and “plus-minus” to “thumbs” and “tick-cross”. This plugin will include a default value for the “Max Ratings”, and you shall adjust the “Individual Rating Text/Value” when using a custom value. It’s best to use 5 stars when using “stars” or “numbers” ratings image.

Customize Ratings AJAX Styles

Scroll down and you will see the options for “Ratings AJAX Style”, “Allow to Rate” and “Logging Method”. Meanwhile, you can use the default settings or customize them for better results. Note that, the “Google Rich Snippets” can be enabled by checking “Yes”. Do check “Save” before going on.

2. Post Ratings Templates
The next section is “Ratings Templates”, and you can use the default or customized “Template Variables” for the current theme. It’s possible to add post rating to all posts, and the shortcode like [ratings id=”11″ results=”true”] will display ratings on that post/page.

Post Ratings Templates

3. Manage Options
Till now, you have added ratings successfully, and those ratings can be viewed via the “Manage Options” section. If needed, you can delete post ratings data or logs completely. A good thing of this plugin is it gives the opportunity to display the “Highest” and “Lowest” rated posts with category and time range options.

Manage Your Ratings Options

Of course, you have more options within “Ratings” widget, such as the minimum votes, maximum post title length, category ID, ratings title & form, etc. Simply use values like 2 days, 1 week and 1 month in your “Time Range”. More suggestions on adding schema type and comment author ratings are available in this usage guide.

Option 2 – Using Yet Another Stars Rating

Yasr is another recommended plugin for adding WordPress post rating system, with more than 9,000 active installs currently. Not only does it let visitors rate on your comments, but also include custom icon size and colors out of the box. All the review scores, including visitor ratings, can be indexed by search engines via snippets, and the newest version is available for free download.

About YASR Plugin

1. Make General Settings
The plugin’s settings page lies in “Settings” > “Yet Another Stars Rating”, and you can decide whether use “Auto Insert” for overall rating, visitor votes or both. The ratings size is editable, and you can display “Overall Rating” and “Visitor Rates” in pages like category pages, homepage and archives.

Ratings General Settings

The remaining options let you add custom text before/after stars, allow everybody or only logged-in users to vote, and decide how “Overall Rating” will be measured.

2. Make Multi Sets
“Multi Set” lets you score every aspect for each review. For example, if you are reviewing a hosting provider, then you can create the aspects like “Customer Service”,” Price Value”, “Server Resource” and “Site Performance”. Note, each “Multi Set” contains up to 9 sub-fields, and you can copy the shortcode at the bottom of this page or use the graphic “Rating” editor to embed it. By default, the color scheme is set to “Light”.

Ratings Multi Sets

3. Make Styles Settings
This option aims to code junkies who want to add CSS styles to override the default settings. You would better leave to the defaults if you don’t know what it means. A Yasr rating box will appear in the upper-right corner of the post/page editor, and the [yasr-overall-rating] shortcode must be added to load the rating.

More advanced features are available in the YASR Pro version (costs $9.9o/yr for single site), such as:

  • Display as many rows as you like in all rankings.
  • Add post type/category filter in post/page rankings.
  • Use different ready-to-use stars sets or upload custom images.
  • Modify the text next to the stars and place it before /after them.

Notes: In addition, there are many WordPress plugins for rating system. For instance, the Rating Widget plugin integrates your website with WooCommerce and BuddyPress users, forum topics, replies and activities. With Multi Rating, you can rate a blog post based on multiple criteria and add custom heights to different rating items.