Site logo

Archived topic

Remove tag H2 in footer and make a or (Merch)

5 replies · Started by Dmytro on August 6, 2020

Viewing posts 1–6 of 6

Good day! For SEO I need:
1. in the footer of the site, remove the H2 tags and make a <span> or

2. product name - remove the H2 tag and make the H3 tag
Thanks in advance for your reply.

Hi there,

you can change the Footer widget titles with this PHP Snippet:

add_filter( 'generate_start_widget_title', 'widget_title_start_tag' );
function widget_title_start_tag()
{ 
    return '<span class="widget-title">';
}

add_filter( 'generate_end_widget_title', 'widget_title_end_tag' );
function widget_title_end_tag()
{ 
    return '</span>';
}

The woo titles HTML are controlled by Woocommerce but you can try this snippet:

remove_action( 'woocommerce_shop_loop_item_title','woocommerce_template_loop_product_title', 10 );
add_action('woocommerce_shop_loop_item_title', 'db_woo_shop_loop_title_h3', 10 );
function db_woo_shop_loop_title_h3() {
    echo '<h3 class="' . esc_attr( apply_filters( 'woocommerce_product_loop_title_classes', 'woocommerce-loop-product__title' ) ) . '">' . get_the_title() . '</h3>';
}

where to register these codes?

Thank you!

You're welcome

This archived topic is closed to new replies.