WooCommerce: Hide Category Images @ Shop

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        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 );

Where to add custom code?

You should place custom PHP in functions.php and custom CSS in style.css of your child theme: where to place WooCommerce customization?

This code still works, unless you report otherwise. To exclude conflicts, temporarily switch to the Storefront theme, disable all plugins except WooCommerce, and test the snippet again: WooCommerce troubleshooting 101

Related content

Rodolfo Melogli

Business Bloomer Founder

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza. Follow @rmelogli

8 thoughts on “WooCommerce: Hide Category Images @ Shop

  1. 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?

    1. 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!

  2. thankyou so much for this =)

    1. You’re welcome!

  3. It worked! I’ve searched for hours for a way to do this and I’m so glad that I found your site.

    1. Thanks!

  4. 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?

Questions? Feedback? Customization? Leave your comment now!
_____

If you are writing code, please wrap it like so: [php]code_here[/php]. Failure to complying with this, as well as going off topic or not using the English language will result in comment disapproval. You should expect a reply in about 2 weeks - this is a popular blog but I need to get paid work done first. Please consider joining the Business Bloomer Club to get quick WooCommerce support. Thank you!

Your email address will not be published. Required fields are marked *