Removing Header Tag from Product Titles in Woocommerce

Woocommerce product titles usually are an h2 or an h3 tag. For SEO purposes, we don’t recommend having all of your product titles listed as header tags. So we want to strip the header tag from the product title.

Change Header Tag on Product Titles for Woocommerce Products

When you want to add your own h1, h2 or h3 tags in the pages that have Woocommerce products on them then you will need to strip the header tag from the product title. 

Insert the code below to the bottom of your functions.php . This will remove the header tag from the Woocommerce product title and create it into your basic paragraph class. 

				
					//WooCommerce - Change Product Title Header Tag to Paragraph Tag
 
function wps_change_products_title() {
 
    echo '<p class="woocommerce-loop-product__title">'. get_the_title() . '</p>';
 
}
 
remove_action('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10);
 
add_action('woocommerce_shop_loop_item_title', 'wps_change_products_title', 10);


				
			
Published 2022/01/04

Share:

More About Our Services:

Do You Have a question? Hit Us up Today!

Good Reads: