Home » WooCommerce: Hide Category Images @ Shop

WooCommerce: Hide Category Images @ Shop

by adminkys

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!

Our objective is to remove product category images in the WooCommerce Shop page when such page is set to display product categories AND products (or product categories only).

PHP Snippet: Remove Product Category Images @ WooCommerce Shop Page

/**
 * @snippet       Hide Cat Images @ WooCommerce Shop / Loop
 * @how-to        Get tutoraspire.com FREE
 * @author        Tutor Aspire
 * @compatible    WooCommerce 4.0
 * @donate $9     https://www.tutoraspire.com
 */

remove_action( 'woocommerce_before_subcategory_title', 'woocommerce_subcategory_thumbnail', 10 );

You may also like