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.
Leave a Reply