[Support request] How to fix multiple H1 tags on my homepage

Home Forums Support [Support request] How to fix multiple H1 tags on my homepage

Home Forums Support How to fix multiple H1 tags on my homepage

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1423120
    Mohamed

    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. ๐Ÿ™‚

    #1423371
    Tom
    Lead Developer
    Lead Developer
    #1423431
    Mohamed

    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

    #1424112
    Tom
    Lead Developer
    Lead Developer

    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 ๐Ÿ™‚

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.