Product Reviews are one of the most powerful selling tools your store has. We have an extension to add fields like qualifier questions (“How did this fit?”) and accept attachments like uploads, but you can add simple text notices to reviews without an extension.

WooCommerce already includes a couple of additional fields in the review form that are not set:

  • comment_notes_before: shown above the name / email fields when the reviewer is not logged in
  • comment_notes_after: shown below the “your review” field for all reviews

The woocommerce_product_review_comment_form_args filter can allow us to change the values of the comment fields on the review form so that we can set something for these fields. This can allow us to add simple text notices / messages to review forms so that customers can have a bit more information while submitting a review.

If you’ve never added code snippets to your site, please check out our tutorial on adding custom code to WordPress.

Add Additional Text to WooCommerce Review Forms

We’ll use both of the fields we mentioned to add our additional text to the WooCommerce review form. Let’s start by adding this code snippet to our site — you can adjust the text here as desired for your own review form:

function sv_add_wc_review_notes( $review_form ) {

    // Shown to non-logged in users above name / email
    $review_form['comment_notes_before'] = '<p style="margin: 0;"><small>Your email will not be published.</small></p>';
    
    // Shown to all reviewers below "Your Review" field
    $review_form['comment_notes_after'] = '<p><em>It\'s very helpful if you include what you liked and didn\'t like!</em></p>';
    return $review_form;
}
add_filter( 'woocommerce_product_review_comment_form_args', 'sv_add_wc_review_notes' );

So what does this do? First, let’s compare the review form for users that are not logged in:

WooCommerce review form

Standard Review Form

WooCommerce review form edited

Edited Review Form

Notice that our text has been added in two places. The comment_notes_before text is added above the form, while the comment_notes_after text is added below the “Your Review” field.

Now let’s take a look at how logged in users will see this form.

WooCommerce review form logged in

Standard Review Form

WooCommerce review form logged in edited

Edited review form

The comment_notes_before text is no longer visible because the name and email fields are not needed for logged-in users. However, the comment_notes_after text is still added below the “Your Review” field.

You can use both of these fields to add instructions or additional information to your WooCommerce review forms.

Published by Beka Rice

Beka leads product direction for SkyVerge, focusing on new features for our plugins and Jilt. She spends a lot of time on research and interviews, but likes to write so she has an excuse to spend more time jamming out to anything from The Clash to Lady Gaga.

3 Comments

  1. Added this to my review form. This is quite useful for me. Much appreciated.
    Lyse

  2. Hi, I have been trying to add a shortcode to the reviews tab with no luck. The shortcode I would like to add is a file upload function so a customer can upload an image when writing a review. The short code works fine on pages and post, but I can’t get it to work in the review tab.

    The shortcode call is:

    Any ideas?

    Shawn

Hmm, looks like this article is quite old! Its content may be outdated, so comments are now closed.