Skip to content

Instantly share code, notes, and snippets.

@jameskoster
Created January 12, 2013 16:01
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save jameskoster/4518617 to your computer and use it in GitHub Desktop.
Save jameskoster/4518617 to your computer and use it in GitHub Desktop.
WooCommerce - hide ratings on product loop
// Remove the product rating display on product loops
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 );
@artboard-studio
Copy link

This is great

@bars38
Copy link

bars38 commented Mar 31, 2013

Thank you!

@samkent
Copy link

samkent commented Mar 26, 2015

You rock!

@jsvini
Copy link

jsvini commented Apr 8, 2015

Thanks!

@jgraffin
Copy link

jgraffin commented Jan 8, 2016

Thanks! And what about ratings on current product?

@eisenheim94
Copy link

Thank you!
For removing rating on single product:
remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10);

@aspirethemes
Copy link

Thanks!

@webvines
Copy link

Hi @eisenheim94,

I tried using -> remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10);

but the ratings in the reviews tab are still showing.

Can you please help me with the code.

Thank you.

@WhiteHatJoker
Copy link

@eisenheim94,

I am having the same issue remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10); code is not working and I am getting duplicate ratings when I reinsert it with add_action.

@nuclearape
Copy link

This looks out of date now... anyone have an updated, working version?

@mennoevertzen
Copy link

@nuclearape

This is the correct one.

remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 );

It's easy to remove hooks when you look in the right file. Open content-product.php in the woocommerce plugin templates folder (or you theme if you have overwritten it) and you will see:

/**
 * woocommerce_after_shop_loop_item_title hook.
 *
 * @hooked woocommerce_template_loop_rating - 5
 * @hooked woocommerce_template_loop_price - 10
 */
do_action( 'woocommerce_after_shop_loop_item_title' );

Then again look at this:

remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 );

And I think it makes sense now.

@nodepunk
Copy link

Alternative way is to use the following statements and add them to Additional CSS field in Customizer panel:

.star-rating {
display: none;
}

@tanmoybiswas87
Copy link

remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 );

@WPFreak
Copy link

WPFreak commented Jun 16, 2018

But how do I do the other way? I am using e-commerce gem theme for my woocommerce site. and by default, star ratings are disabled on shop page and category page. How do I enable it now? By the way, I am using a child theme.

@sammtek
Copy link

sammtek commented Jul 2, 2018

where do i put this line of code, i'm completely new to this, help?

@alanzhaonys
Copy link

remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 );

This is not working for me.

@Milevan
Copy link

Milevan commented Feb 19, 2019

remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 );
not working for me either

@FurkanUcar010
Copy link

This is not working anymore
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 );

In this way, you could now take it off
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10 );

@ijjimem
Copy link

ijjimem commented Sep 27, 2022

Not working anymore again.

This is not working anymore remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 );

In this way, you could now take it off remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10 );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment