This tutorial demonstrates how to enable reviews (comments) and ratings for all WooCommerce products. To bulk update the comment status for a selected group of products, please see the article How to Bulk Edit WooCommerce Products in WordPress.
If the reviews tab is missing on the single product page, this tutorial may also be beneficial to enable customer reviews for the products with the comment status turned off.
What are WooCommerce Product Reviews?
When you are thinking about buying a product online you probably read the reviews before making the purchase. Everyone does this now, and a comment from someone who has already made the purchase weighs heavily on the buying decision. If you have an E-commerce website that doesn’t allow product reviews and ratings, your sales may be affected and the products might not even sell at all!
Luckily, WooCommerce has a built-in review and star rating system for products. How the reviews and star ratings look on the single product page will depend on the theme being used, and a plugin like All In One Schema Rich Snippets or WP Review Pro can extend this functionality to improve better search results on Google.
Depending on how your website is configured to handle comments, you may have to manually edit each product to turn this powerful feature on. This might take quite a while if you have a large catalog of products and don’t want to use the bulk edit process.
This tutorial will show you how to globally turn on reviews (comments) at once for every product using a single SQL query in phpMyAdmin.
Step 1. Configure Discussion Settings in WordPress
WooCommerce product reviews are handled the same way as comments in WordPress. This is because products are a custom post type and can receive comments if enabled. When a review is added to a product, it may be held for moderation or immediately become live depending on the WordPress comment settings.
Comment settings can be configured in the WordPress admin by visiting the Discussion Settings page:
Settings > Discussion
It is important to mention that the Allow people to post comments on new articles field should be checked if you want comments enabled by default for new posts and products.
Step 2. Enable Reviews (Comments) in WooCommerce Settings
The next step is to enable product reviews in WooCommerce. This will add a reviews tab on the single product page for the customer reviews and product ratings.
WooCommece > Settings > Products (tab)
The following options are available:
- Enable product reviews
- Show “verified owner” label on customer reviews
- Reviews can only be left by “verified owners”
- Enable star ratings on reviews
- Star ratings should be required, not optional
Step 3. Use phpMyAdmin to Enable Reviews (Comments) for All Products
This step will require access to phpMyAdmin. The hosting account cPanel will usually allow access. Once you have logged in:
- Select the WordPress database from the sidebar on the left.
- Click the SQL tab.
- Copy and paste the following code into the RUN SQL query/queries box.
- If you used a database prefix other than wp_ then you will need to change wp_posts to match the database table name on the left sidebar.
- Click Go on the bottom right of the box to run the query.
UPDATE wp_posts SET comment_status = 'open' WHERE post_type = 'product';
If you are unfamiliar or uncomfortable using phpMyAdmin, another solution is to use the One Click Close Comments plugin. It uses an AJAX-powered color code indicator (red means closed and green means open) on the post/product admin screens to update the comment status. You will still have to click each product one at a time, but the plugin is handy to visually determine which products have comments closed or open.
If you want to close reviews (comments) for all products:
UPDATE wp_posts SET comment_status = 'closed' WHERE post_type = 'product';
If you want to require a user to be logged in to review products:
UPDATE wp_posts SET comment_status = 'registered_only' WHERE post_type = 'product';
Don’t forget to backup your database first before making any changes to it!