Hide WooCommerce Category h1 Tag

3d Animation

I’ve always struggled to style the WooCommerce Category/Product Archive pages as the h1 tag is hard-wired into the template. I’ve found this code snippet to add to your theme’s function.php file which stops the default h1 tag displaying on product archive pages.

Please note you’ll need to make sure you manually add your h1 tags to your WooCommerce archive pages moving forward.

You can also hide the h1 tags using CSS but this doesn’t stop them from showing up in the source code, so stopping them from displaying in the first place is probably best practice.


if(apply_filters('woocommerce_show_page_title' , true)){

add_filter( 'woocommerce_show_page_title' , 'woo_hide_page_title' );
function woo_hide_page_title() {
	return false;
}
}