How to Hide Product Reviews in WooCommerce Store

How to hide product reviews in woocommerce; Disable reviews on woocommerce product page; Remove reviews from woocommerce products; Hide reviews for specific products in woocommerce; Turn off product reviews in woocommerce; Woocommerce hide reviews for one product; Disable woocommerce reviews for certain products; Remove customer reviews from woocommerce; How to disable reviews in woocommerce; Woocommerce product reviews disable;

Explanation

If you're looking to hide or disable product reviews in WooCommerce, here's a simple way to do it:

  • Disable Reviews Globally: This will turn off reviews for all products in your store. It stops the review feature from being available on any product.
  • Hide Reviews for Specific Products: You can choose certain products where reviews won't be shown. Just replace the numbers in the list with the IDs of the products you want to hide reviews for.
  • Remove Reviews Tab: This removes the reviews tab from the product pages, so customers won't see the option to view or leave reviews.
  • Remove Reviews from Product Loop: This stops the star ratings from appearing under products when they're listed in a category or on the shop page.

By using these functions, you can control how and where reviews appear on your WooCommerce store, making it easy to customize the shopping experience for your customers.

Code

// Function to disable reviews globally in WooCommerce
function wp_dudecom_disable_reviews_globally() {
    remove_post_type_support( 'product', 'comments' );
}
add_action( 'init', 'wp_dudecom_disable_reviews_globally' );

// Function to hide reviews for specific products in WooCommerce
function wp_dudecom_hide_reviews_for_specific_products( $open, $post_id ) {
    $product_ids_to_hide_reviews = array( 123, 456, 789 ); // Replace with your product IDs

    if ( in_array( $post_id, $product_ids_to_hide_reviews ) ) {
        return false;
    }

    return $open;
}
add_filter( 'comments_open', 'wp_dudecom_hide_reviews_for_specific_products', 10, 2 );

// Function to remove reviews tab from product pages
function wp_dudecom_remove_reviews_tab( $tabs ) {
    unset( $tabs['reviews'] );
    return $tabs;
}
add_filter( 'woocommerce_product_tabs', 'wp_dudecom_remove_reviews_tab', 98 );

// Function to remove reviews from the product loop
function wp_dudecom_remove_reviews_from_loop() {
    remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 );
}
add_action( 'init', 'wp_dudecom_remove_reviews_from_loop' );

Instructions

To hide product reviews from your WooCommerce store view, follow these steps:

File Location: You can add the code to your theme's functions.php file or create a custom plugin file.

Prerequisites: Ensure you have WooCommerce installed and activated on your WordPress site.

Implementation Steps:

  1. Access your WordPress Admin Dashboard: Log in to your WordPress admin panel.
  2. Navigate to Theme Editor: Go to Appearance > Theme Editor. If you prefer using a custom plugin, navigate to Plugins > Add New > Create a Plugin.
  3. Open functions.php or Plugin File: If using the theme editor, locate and open the functions.php file. If creating a plugin, open your plugin file.
  4. Copy and Paste the Code: Insert the provided code into the file. Ensure it's placed at the end of the file or in an appropriate section if using a plugin.
  5. Save Changes: Click Update File to save your changes.
  6. Verify the Changes: Visit your WooCommerce store to ensure that product reviews are hidden as intended.

By following these steps, you can effectively manage the visibility of product reviews on your WooCommerce store. If you need further assistance or advanced customization, consider reaching out to wp-dude.com for expert help.