Black Friday All Access $999 $399 lifetime or 30% off any plugin with Ends in -- See deals
WooCommerce Guides February 12, 2024 3 min read

How to Stop Fake WooCommerce Reviews & Only Allow Verified Buyers

How to Stop Fake WooCommerce Reviews & Only Allow Verified Buyers

Quick answer: Go to WooCommerce → Settings → Products and tick Reviews can only be left by “verified owners”. Only logged-in customers who bought the product can then post a review, which blocks fake reviews. This article also shows how to let guest buyers, who don’t have an account, leave verified reviews.

Have you ever wanted to leave a review on a website but got this message?

“Only logged in customers who have purchased this product may leave a review.”

And wondered how you can create it for your own store?

Before getting there, let’s all agree that customer reviews can be a double-edged sword. 

It could benefit you by adding a social proof element to your products, but your competitors could use them in unethical ways to destroy your reputation.

So you need to make sure you don’t fall into the trap of fake negative reviews. Keep reading to learn how to only allow reviews from verified buyers in WooCommerce.

The Simple Way of Allowing Reviews From Verified Buyers

This way is very simple and straightforward, you would just adjust the WooCommerce settings to only allow verified purchases, following these steps:

  • WooCommerce → Settings → Products → Reviews can only be left by “verified owners”

Using this simple step the only reviews allowed would be by logged-in users who’ve already bought the product.

The downside of this method though is that it doesn’t account for guest purchases, users who haven’t created an account while buying the product won’t be able to leave a review if you follow this method.

Email Verification for WooCommerce

How to Modify the WooCommerce Review System to Recognize Guest Purchases?

Modifying the WooCommerce review system to recognize guest purchases involves custom coding or using plugins that can link reviews to guest orders.

A typical approach might include developing a custom function that checks the order database for a matching email address and product ID when a review is submitted. If a match is found, the review could be marked as “verified.” 

Here’s a simplified example of what the code might look like:

function verify_guest_reviewer($comment_author_email) {

 $args = array(

 'post_type' => 'shop_order',

 'post_status' => array('wc-completed'),

 'numberposts' => -1,

 'meta_query' => array(

 array(

 'key' => '_billing_email',

 'value' => $comment_author_email,

 'compare' => '=',

 ),

 ),

 );

 $orders = get_posts($args);

 if ($orders) {

 // The guest has completed orders, proceed with verifying the review

 return true;

 } else {

 // No completed orders found for this email, do not verify the review

 return false;

 }

}

 

// Hook into the review submission process to verify guest reviewers

add_filter('pre_comment_on_post', 'verify_guest_reviewer');

This code is a basic illustration and would need to be adapted to specifically check if the guest user has purchased the product being reviewed. It checks for completed orders by the guest’s email address. Remember, implementing this requires careful testing to ensure it doesn’t interfere with the normal operations of your site and respects privacy and security standards.

used in this guide

Cost of Goods

Your store is leaking margin. Let's show you where. Pay once, use it on every store you run.

all access · lifetime

The plugins behind most of what we write about.

A lot of the posts here reference WPFactory plugins because that's what we build with. All Access gets you every plugin we make, on as many sites as you run. Pay once. Own it.

lifetime, once
$ 499 once
vs. $199 per plugin lifetime, pays back at your 3rd plugin
  • Every WPFactory plugin, current and future
  • Unlimited sites, no per-site caps
  • Lifetime updates, no renewals
  • 30-day refund, no questions asked