No results found. Try again with different words?

Search must be at least 3 characters.

Change Sidebar Widget Title Heading Tag

Sidebar Image

Did not find a solution? We are here to help you succeed.

Astra empowers you to take control of your sidebar’s presentation by allowing you to modify the default heading tag H2 used for widget titles.

Remember, the default H2 tag makes the titles stand out, but you can choose a different tag (H3, H4, etc.) depending on the desired hierarchy and visual balance on your pages.

By following the steps outlined in this help document, you can easily adjust the heading tag for your blog/archive, shop page’s widget titles.

How to Change Blog/Archive Page Sidebar Widget Title Heading Tag

When you add a legacy widget in the sidebar for blog/archive pages, a default heading tag that will be applied to widget title is H2

Astra Heading Title

If you wish to change this heading tag use the following custom code. Add the code in the child theme’s functions.php file. 

add_filter( 'astra_widgets_init', 'widget_title_tag', 10, 1 );

function widget_title_tag( $atts ) {
    $atts['before_title'] = '<h4 class="widget-title">';
    $atts['after_title'] = '</h4>';

    return $atts;
}

In the above code H2 heading tag is changed to H4. You can enter the required heading tag as per your requirement.

Change Shop Page Sidebar Widget Title Heading Tag

Just like blog and archive pages, Astra uses the H2 heading tag by default for widget titles on your shop page. This means the widget titles will appear slightly larger and more prominent compared to other headings on the page.

If you wish to change this heading tag use the following custom code. You can add the code in the child theme’s functions.php file. 

// Add a filter to modify the store widgets dynamic settings
add_filter( 'astra_woocommerce_shop_sidebar_init', 'child_widget_title_tag', 10, 1 );
function child_widget_title_tag( $atts ) {
    $atts['before_title'] = '<h4 class="widget-title">';
    $atts['after_title'] = '</h4>';
    return $atts;
}

In the above code H2 heading tag is changed to H4. You can enter the required heading tag as per your requirement.

We hope this document has equipped you with the knowledge to personalize your blog/archive and shop page’s sidebar widget titles. If you have any further questions or require additional assistance, feel free to leave a comment below.

Was this article helpful?
Sidebar Image

Did not find a solution? We are here to help you succeed.

Related Docs

Join 1,653,898+ Happy Site Owners Using Astra

Whether you are a beginner, small business owner, or professional web developer, Astra provides all the tools you need to easily build your beautiful WordPress website.

Download is Just A Click Away!

Membership Retention Checklist Download

REWIND

YEAR IN REVIEW

Download is Just A Click Away!

Enter your email address and be the first to learn about updates and new features.

Download Free Astra Theme - Modal Popup Form
Scroll to Top
Now choose your preferred
page builder addon
Choose your preferred page builder addon

Download is Just A Click Away!

Enter your email address and be the first to learn about updates and new features.

Download Free Astra Theme - Modal Popup Form