Site logo

Archived topic

How to fix multiple H1 tags on my homepage

3 replies · Started by Mohamed on August 29, 2020

Viewing posts 1–4 of 4

Hi

I seem to have multiple H1 tags on my homepage for both menus on PC and mobile navigations
But the other site that has logo didn't have any H1
Please help. Thanks in advance. 🙂

Thanks Tom,
But I already saw the thread that you shared but it's not a fix!!
(the H1 in home page must displayed depend on device condition to be one only).

So, I open a new support topic and I need two solutions for this point

1- Remove duplicated H1 in the Homepage
2- How add H1 to Home page of site that has a logo?

Regards

The conclusion of that thread was that there is no harm in having a desktop and mobile H1 - Google will not penalize you for it, and it's better for accessibility.

However, you can tell GP not to make the titles an H1 like this:

add_filter( 'generate_site_title_output', function() {
    return sprintf(
        '<p class="main-title" itemprop="headline">
            <a href="%1$s" rel="home">
                %2$s
            </a>
        </p>',
        esc_url( apply_filters( 'generate_site_title_href', home_url( '/' ) ) ),
        get_bloginfo( 'name' )
    );
} );

Then you can use a Hook Element (https://docs.generatepress.com/article/hooks-element-overview/) to add an H1 to your homepage.

Let us know if you need more info :)

This archived topic is closed to new replies.