In WooCommerce, product reviews are a powerful way to build trust and encourage future purchases.
If you want to avoid spam, you’d usually select the “Reviews can only be left by verified owners” option, so that only logged in customers can leave reviews.
This can be limiting, especially if you want to allow verified buyers who are not logged in to share their feedback, without forcing them to log in first.
In this tutorial, I’ll show you how to customize WooCommerce to allow logged-out verified customers to leave product reviews.
With a simple PHP snippet, we’ll adjust WooCommerce review settings to accept reviews from users who have purchased a product, regardless of their login status. This way, you can enhance the customer experience while maintaining authenticity and security for product feedback.
Let’s dive into the code and get started!
Step 1: Disable “Reviews can only be left by verified owners”
By disabling this setting, we are allowing users to submit product reviews even if they are logged out (so, anyone can post them, including spam bots):

This is only the first step, because now we need some custom code to make sure we “validate” each product review, by double checking if the posted email address is the one of a verified customer.
Step 2: PHP Snippet to Block Product Reviews from Non-WooCommerce Customers
/**
* @snippet Reject Review If Email Address Is Not a Woo Customer
* @how-to businessbloomer.com/woocommerce-customization
* @author Rodolfo Melogli, Business Bloomer
* @compatible WooCommerce 9
* @community https://businessbloomer.com/club/
*/
add_filter( 'preprocess_comment', 'bbloomer_product_review_logged_out_only_verified' );
function bbloomer_product_review_logged_out_only_verified( $comment ) {
if ( 'product' === get_post_type( $comment['comment_post_ID'] ) ) {
if ( $comment['comment_author_email'] && ! $comment['user_id'] && ! wc_customer_bought_product( $comment['comment_author_email'], '', $comment['comment_post_ID'] ) ) {
wp_die( 'This email address does not appear to be associated with a customer who has purchased this product. Only verified customers can leave a review.' );
}
}
return $comment;
}
Result: Review Form For Logged Out Users + Error Message
Once step 1 and step 2 are done, this is the form you see inside the “Reviews” tab on the WooCommerce Single Product Page:

The only difference is that if you use an email address that does not belong to a WooCommerce customer, you will now get a full-page error message:

And this is it… now “verified customers” don’t need to be logged in if they wish to leave a product review, hence your “product review submit” conversion rate may go up!