Nicola Mustone

Happiness Lead @ Automattic



Removing the Review Date

WooCommerce includes a built-in reviews system to allow customers to leave a review for the products they purchased.

It shows their comment, a rating from 1 to 5, the customer name and avatar, the review date and (if enabled) a label that indicates if the customer is a verified owner of that product.

Let’s talk more about the date. Imagine that you just moved from another platform to WooCommerce. All your reviews will probably show the current date instead of their original date. That would be annoying, so a solution would be to simply hide the review date.

How would you do that?

Override the Reviews Template

The only solution at the moment is to override the templates.

The date is hard-coded in a template and there are not hooks to remove it. You could still hide it via CSS, but then search engines can still read it on your page, so let’s remove it completely.

The template that shows the review date is wp-content/plugins/woocommerce/templates/single-product/review-meta.php. Copy this file and paste it in wp-content/themes/your-child-theme-name/woocommerce/single-product/.

If the path woocommerce/single-product/ does not exist in your theme, create it.

Now open the file that you just pasted and remove this part of the code, on line 39:

<span class="woocommerce-review__dash">–</span> <time class="woocommerce-review__published-date" itemprop="datePublished" datetime="<?php echo get_comment_date( 'c' ); ?>"><?php echo get_comment_date( wc_date_format() ); ?></time>

The review date will not show from now on.

Advertisements

Subscribe to This Blog

Receive new articles from this blog directly in your inbox! No spam guaranteed!

Join 651 other subscribers

Contribute to Improving This Blog

Did you enjoy this article? Was it helpful? Contribute to help me write more articles! The funds collected from this blog are reinvested directly into improving my skills or the blog so that I can provide more and better content!

One-Time
Monthly
Yearly

Make a one-time donation

Make a monthly donation

Make a yearly donation

Choose an amount

€5.00
€15.00
€100.00
€5.00
€15.00
€100.00
€5.00
€15.00
€100.00

Or enter a custom amount


Your contribution is appreciated.

Your contribution is appreciated.

Your contribution is appreciated.

DonateDonate monthlyDonate yearly
Advertisements

More Posts That You Might Like…


11 responses to “Removing the Review Date”

  1. […] Mustone has a quick guide to removing the review date from WooCommerce product reviews (helpful if you’ve imported […]

  2. Thank you so much!! That worked like a charm 🙂 I have been pulling my hair out trying to figure out where to find that code!

    1. You’re welcome Thomas 🙂

  3. Thank you so much Nicola. Very helpful !

    1. You’re welcome Cole!

  4. Hello i have a problem, i am using filezilla, and cant duplicate files… so basicly i cant move that file to the child theme and changfe it before… any solutions?

  5. Hi Nicola!

    Thanks for your code to hide the review date. In your post, you mention:

    “The date is hard-coded in a template and there are not hooks to remove it. You could still hide it via CSS, but then search engines can still read it on your page, so let’s remove it completely.”

    How would be the CSS to achieve the same objective? and what do you mean by search engines still being able to read the review date? When someone searches the product, they will find the review as a search link as any other links provided by Google?

    Thank you for your help!

    1. Hi Federico,
      Via CSS you would use display: none on the review date element to hide it.

      and what do you mean by search engines still being able to read the review date?

      I mean that search engine bots ignore CSS. If an element is hidden via CSS it will still be visible to bots since they read the source of the page, not what the customer sees. So the review date might be element of ranking or other things that search engines do with it.

  6. I deleleted the text but nothing changes please help me !

  7. Just did it but I doesn’t work. Any other solutions?
    How about the css code as an alternative?

    Looking forward to your reply. 🙁

  8. Hi and thanks, it works well.

    What is the reason for changing the directory? My guess is, that when I update Woocommerce, the changes will be overwritten. Whereas if I copy it to the child theme, the changes will be safe.

    There is no other difference I guess, works without coppying the file as well.

Leave a Reply

Advertisements

Categories

Newsletter

Receive new articles from this blog directly in your inbox!

No spam guaranteed!

Join 651 other subscribers

About The Author

Hi, I’m Nico! Support Lead at Automattic, championing WordPress.com & WooCommerce. Off-duty, I’m at Elemental Beacon, leading epic D&D adventures. Let’s connect, whether it’s about WordPress or a quest!

Advertisements

Don't Miss a Thing!

Receive new articles from this blog directly in your inbox!

No spam guaranteed!

Join 651 other subscribers

Continue Reading

%d bloggers like this: