Get a fast, conversion-focused WooCommerce theme in 2026. Switch to Shoptimizer.

Home Documentation Shoptimizer Code Snippets Change Product Title Markup on Shop/Catalog

Change Product Title Markup on Shop/Catalog

If you want to change the product title markup on the shop/catalog pages to use a h2 or h3 you can do so with a custom function. Add the following code to either the functions.php file of a child theme or via the Code Snippets plugin.

add_action( 'after_setup_theme', 'cg_remove_shop_loop_item_title', 99 );
function cg_remove_shop_loop_item_title() {
remove_action( 'woocommerce_shop_loop_item_title', 'shoptimizer_loop_product_title', 10);
}

add_action( 'woocommerce_shop_loop_item_title', 'shoptimizer_loop_product_title_revised', 10);
function shoptimizer_loop_product_title_revised() {

    global $post;

    $shoptimizer_layout_woocommerce_display_category = '';
    $shoptimizer_layout_woocommerce_display_category = shoptimizer_get_option( 'shoptimizer_layout_woocommerce_display_category' );
    ?>
        <?php if ( true === $shoptimizer_layout_woocommerce_display_category ) { ?>
            <?php echo '<p class="product__categories">' . wc_get_product_category_list( get_the_id(), ', ', '', '' ) . '</p>'; ?>
        <?php } ?>
        <?php
        echo '<h2 class="woocommerce-loop-product__title"><a href="' . get_the_permalink() . '" aria-label="' . get_the_title() . '" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">' . get_the_title() . '</a></h2>';
}

In this example we’re using a h2, but you can obviously adjust the code to use a h3 instead if you wish.

Success!

The discount has been applied. You will see it when you checkout.

There has been a problem

Unfortunately this discount cannot be applied to your cart.

$50
Off

Do you want a whopping $50 off Shoptimizer for WooCommerce?

Click the button below to get Shoptimizer for only $49. (Regular price: $99).
This is a special launch offer for today only.
Get it before it is gone!