How to disable product reviews in WooCommerce

WordPress Snippets

To disable product reviews in WooCommerce using the functions.php file, you can use a combination of the wp_dequeue_script and wp_dequeue_style functions to remove the necessary scripts and styles, and the comments_open and pings_open filters to disable comments and trackbacks on products.

Here is an example of how you can do this:

// Disable product reviews in WooCommerce
// More snippets at wpunplugged.com 

function remove_product_reviews() {
    // Remove review form scripts and styles
    wp_dequeue_script('woocommerce-review-rating');
    wp_dequeue_style('woocommerce-review-rating');

    // Disable comments and trackbacks on products
    add_filter('comments_open', '__return_false', 10, 2);
    add_filter('pings_open', '__return_false', 10, 2);
}
add_action('wp_enqueue_scripts', 'remove_product_reviews');

This code will remove the review form scripts and styles, and disable comments and trackbacks on products.

It’s important to note that this code will only remove the review form and disable comments and trackbacks on the front-end of your site. If you want to completely remove the review functionality from the back-end as well, you will need to use a plugin or additional code to do so.

Share this post

You might also like...

Backup

Jetpack for WordPress Review

Jetpack for WordPress is an amazing plugin that offers a wide range of features to help make your WordPress website more secure, efficient and user-friendly.

Read More »
WooCommerce for WordPress Review
Ecommerce

WooCommerce for WordPress Review

WooCommerce for WordPress is a great choice for anyone looking to create an online store. Its user-friendly interface makes setup and customization simple, while its

Read More »

Comment

Your email address will not be published. Required fields are marked *