Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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 );
@human-a

This comment has been minimized.

Show comment Hide comment
@human-a

human-a Jan 26, 2013

This is great

human-a commented Jan 26, 2013

This is great

@bars38

This comment has been minimized.

Show comment Hide comment
@bars38

bars38 Mar 31, 2013

Thank you!

bars38 commented Mar 31, 2013

Thank you!

@samkent

This comment has been minimized.

Show comment Hide comment
@samkent

samkent Mar 26, 2015

You rock!

samkent commented Mar 26, 2015

You rock!

@jsvini

This comment has been minimized.

Show comment Hide comment
@jsvini

jsvini Apr 8, 2015

Thanks!

jsvini commented Apr 8, 2015

Thanks!

@jgraffin

This comment has been minimized.

Show comment Hide comment
@jgraffin

jgraffin Jan 8, 2016

Thanks! And what about ratings on current product?

jgraffin commented Jan 8, 2016

Thanks! And what about ratings on current product?

@eisenheim94

This comment has been minimized.

Show comment Hide comment
@eisenheim94

eisenheim94 Jan 19, 2016

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

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

@ghost

This comment has been minimized.

Show comment Hide comment
@ghost

ghost Mar 23, 2016

Thanks!

ghost commented Mar 23, 2016

Thanks!

@webvines

This comment has been minimized.

Show comment Hide comment
@webvines

webvines Jun 23, 2016

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.

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

This comment has been minimized.

Show comment Hide comment
@WhiteHatJoker

WhiteHatJoker Jun 23, 2016

@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.

@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

This comment has been minimized.

Show comment Hide comment
@nuclearape

nuclearape Mar 28, 2018

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

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

@mennoevertzen

This comment has been minimized.

Show comment Hide comment
@mennoevertzen

mennoevertzen Apr 6, 2018

@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.

@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.

@prodomedia

This comment has been minimized.

Show comment Hide comment
@prodomedia

prodomedia Apr 10, 2018

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

.star-rating {
display: none;
}

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

.star-rating {
display: none;
}

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