The Woocommerce by default allows users to leave reviews in the product pages. You can disable them by two methods:
Edit A Product Property
If you edit the product, you will find the ‘Allow Comments’ in the product property ‘Advance’ Tab. You can simply untick that so disallow reviews for that particular product.
Disable All Product Reviews Globally
You can edit the theme functions.php template and add the following:
1 2 3 4 5 | add_filter( 'woocommerce_product_tabs', 'helloacm_remove_product_review', 99); function helloacm_remove_product_review($tabs) { unset($tabs['reviews']); return $tabs; } |
add_filter( 'woocommerce_product_tabs', 'helloacm_remove_product_review', 99); function helloacm_remove_product_review($tabs) { unset($tabs['reviews']); return $tabs; }
The value 99 (third parameter) is the priority.
–EOF (The Ultimate Computing & Technology Blog) —
GD Star Rating
loading...
164 wordsloading...
Last Post: How to Remove Admin TopBar in WordPress?
Next Post: Some Issues Reported by FixInsight Static Delphi Code Analyser
Hello an Thank you !
I don;’t know why but it was not possible anymore to hide the products review from Woocommerce settings, so I used your code below and it worked !
Thank you again
add_filter( ‘woocommerce_product_tabs’, ‘helloacm_remove_product_review’, 99);
function helloacm_remove_product_review($tabs) {
unset($tabs[‘reviews’]);
return $tabs;
}
I am Glad it helps