If your Appearance > Customize > WooCommerce > Product Catalog > Shop page display is set to “Show categories and products“, parent product categories will show in the “products loop” as the very first elements (see screenshot below). They really take up a lot of space and this could be annoying at times, mostly when you don’t use product category images.
Thankfully, if this makes sense to you and your customers, you can remove them easily (it’s one line of code). Also, this works really well when the number of parent product categories is proportional to the number of shop display columns (e.g. you have 6 parent categories and you have 3 products per row under Appearance > Customize > WooCommerce > Product Catalog > Shop page > “Products per row”). Enjoy!
PHP Snippet: Remove Product Category Images @ WooCommerce Shop Page
/**
* @snippet Hide Cat Images @ WooCommerce Shop / Loop
* @how-to businessbloomer.com/woocommerce-customization
* @author Rodolfo Melogli, Business Bloomer
* @compatible WooCommerce 4.0
* @community https://businessbloomer.com/club/
*/
remove_action( 'woocommerce_before_subcategory_title', 'woocommerce_subcategory_thumbnail', 10 );
Hi,
I would like a page with just the subcategories of a category
I would like to have this as just a list of the names and no images. I see the code at the top, What do I need to do to only exclude the images for this category?
Hello Lynn, the hook gives you access to the $category parameter, so you can trigger the function only for a specific category. Hope this helps and makes sense!
thankyou so much for this =)
You’re welcome!
It worked! I’ve searched for hours for a way to do this and I’m so glad that I found your site.
Thanks!
Hi, I have only 8 products so it does not make sense to show their categories images. I use Categories as main product feature and wish to display the category text below product title on main Shop page. Is something like that possible?
This may help: https://www.businessbloomer.com/woocommerce-show-product-subcategories/