Home » WooCommerce + Storefront Theme: Hide Homepage Title

WooCommerce + Storefront Theme: Hide Homepage Title

by adminkys

The Storefront theme displays the homepage H1 title by default, no matter if you use the “Default” or the “Homepage” page template.

Of course, you could do it via CSS, with a simple “display:none”. Even better, you could completely avoid loading the homepage title by using PHP (SEOs out there: better not to load an H1 than hiding it via CSS, right?).

So, how do they do it? Here’s the quick fix!

Storefront theme: how to remove the homepage title

PHP Snippet 1: Remove Homepage Title @ Storefront (“Homepage” Page Template)

/**
 * @snippet       Hide Homepage Title - Storefront Homepage Page Template
 * @how-to        Get tutoraspire.com FREE
 * @author        Tutor Aspire
 * @compatible    WooCommerce 6
 * @donate $9     https://www.tutoraspire.com
 */

add_action( 'wp', 'tutoraspire_storefront_remove_title_from_home_homepage_template' );

function tutoraspire_storefront_remove_title_from_home_homepage_template() {
remove_action( 'storefront_homepage', 'storefront_homepage_header', 10 );
}

PHP Snippet 2: Remove Homepage Title @ Storefront (“Default” Page Template)

/**
 * @snippet       Hide Homepage Title - Storefront Default Page Template
 * @how-to        Get tutoraspire.com FREE
 * @author        Tutor Aspire
 * @compatible    WooCommerce 6
 * @donate $9     https://www.tutoraspire.com
 */

add_action( 'wp', 'tutoraspire_storefront_remove_title_from_home_default_template' );

function tutoraspire_storefront_remove_title_from_home_default_template() {
if ( is_front_page() ) remove_action( 'storefront_page', 'storefront_page_header', 10 );
}

You may also like