How to change the WooCommerce product loop title from H2 to H3

In the below image you can see. By default, WooCommerce displays the title in the H2 tag which can be bigger or smaller according to design. let’s see how we can change the tag with a simple snippet.

Before applying snippet

Here is a useful snippet that makes it easy to change the title tag. Add the following to the function.php in your child theme.

//WooCommerce Change Title from H2 -> H3

function wps_change_products_title() {

    echo '<h3 class="woocommerce-loop-product__title">'. get_the_title() . '</h3>';

}

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);
After applying snippet

Edit WooCommerce Products from Frontend

3 thoughts on “How to change the WooCommerce product loop title from H2 to H3”

Leave a Comment

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

Scroll to Top