How To Add Guest Badge To WooCommerce Reviews

Add Guest Badge To WooCommerce

Guest Shopper badge and Verified Shopper badge for WooCommerce stores.

One of the hardest things to do nowadays is to get reviews for your products. Not to mention legit ones at that. When we created Hush + Dotti we struggled with getting reviews. Nobody wanted to sign in and jump thru hoops to do it. It’s simply a hassle.

And as many of you know, WordPress & WooCommerce have a major bullseye on their backs when it comes to spam bots taking over our websites.

So what I did was open up the commenting to everybody, even “Guest” shoppers and added filters to WordPress’ new discussion blocker. So now guest shoppers can write a review. No having to register and login or give their personal information. Now more shoppers are apt to write a review and this Guest Buyer label gets applied to their review.

I recommend you only add this to your child theme. Adding custom code to a premium paid theme can cause issues down the road and you might end up overwriting yourself if you update the parent theme some day.

Ok, so let’s get started. Head over to your review-meta.php file and look for this line. If you don’t know where the file is located look here first. Some premium eCommerce themes have a folder called woocommerce. The file path would be woocommerce > single-product > review-meta. If it’s not in there you’re going to need to make a copy of this file to your child theme from WooCommerce plugin folder. Do not edit in the plugin and don’t add this to your parent theme.

if ( 'yes' === get_option( 'woocommerce_review_rating_verification_label' ) && $verified ) {
			echo '(' . esc_attr__( 'verified owner', 'woocommerce' ) . ') ';

Now here’s where we’re going to rewrite and add guest badge for WooCommerce. Right here in this¬† section like so.

if ( 'yes' === get_option( 'woocommerce_review_rating_verification_label' ) && $verified ) {
	   echo ' ' . esc_attr__( 'verified buyer', 'woocommerce' ) . ' ';
		} else {
             //simply add copy the woocommerce-review__verified from above and change the last part to guest
           echo ' ' . esc_attr__( 'guest buyer', 'woocommerce' ) . ' '; //Change the phrase Verified Buyer to Guest Buyer

In the end you’re going to want your review-meta file to look like this. You’ll notice I use FontAwesome with my theme so the verified checkmark shows for each person’s review. I feel it gives the review a bit more authenticity.

Leave a Reply