Hide shop page heading in WooCommerce without affecting other pages

I need help hiding the main heading on my WooCommerce shop page only. When I try to hide it using basic CSS, it removes headings from every page on my site which is not what I want.

.main-title h1 { display: none; }

I found the post ID for my shop page and tried targeting it specifically but this approach doesn’t work:

.postid-23847 .main-title h1 { display: none; }

I also attempted using a filter in my theme’s functions file:

add_filter( 'woocommerce_shop_page_title', '__return_false' );

This code doesn’t seem to have any effect either. I think the issue might be that I’m targeting the wrong element or using the wrong approach. How can I specifically remove just the shop page title without touching titles on other pages?

try adding this class: .woocommerce-shop .main-title h1 { display: none; } it should only hide the title on ur shop page without affecting the rest. hope this helps!

That functions.php filter is correct - it’s probably a theme conflict. I ran into this same thing last year. Some themes override WooCommerce templates and block the filter from working. Here’s what fixed it for me: keep your PHP filter, but add this CSS too: body.woocommerce-shop .entry-header { display: none; }. Still not working? Right-click and inspect your shop page to see how your theme structures things. Different themes wrap the shop title differently - could be .page-header, .entry-title, or .archive-header. Find the right parent container, then target it with the body class selector.

Had the exact same issue last month with a client’s site. Turned out to be browser caching plus theme-specific selectors messing things up. Clear your browser cache completely after CSS changes - this got me multiple times. The WooCommerce filter should work, but custom page templates can override it. I used dev tools to inspect the shop page and find the actual class structure. Mine ended up being .woocommerce-products-header .woocommerce-products-header__title instead of the generic selectors I’d been trying. Also check if your theme has built-in options to hide page titles - lots of modern themes include this in customizer settings under WooCommerce.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.