One of the most important elements on a product page is user generated content. This can take the form of pictures, reviews, star ratings, etc. All of this is called social proof. Social proof is a huge factor in someone else's purchase decision. Getting someone to buy a product from a random website is very hard. If you have a few reviews, that eases people's fears and they'll be more likely to buy. 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 reviews:
- Enable product reviews
- Show “verified owner” label on customer reviews
- Reviews can only be left by “verified owners”
Product ratings:
- 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';
Final Thoughts
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!