[Resolved] Multiple H1 tags on home page

Home Forums Support [Resolved] Multiple H1 tags on home page

Home Forums Support Multiple H1 tags on home page

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1372384
    Andrew

    Hi

    I seem to have multiple H1 tags on my homepage. The first one seems to be the correct one – It has taken my site title and put it as the H1 tag. The second H1 tag seems to be a duplicate of that and just below the first one but has put it in a “navigation-branding” div class for some reason.

    On single post and pages, it’s fine – There is only one H1 tag.

    Please help. Thanks in advance. 🙂

    #1372426
    Leo
    Staff
    Customer Support

    Hi there,

    I’m only seeing the site title as <h1> which is the default:
    https://www.screencast.com/t/7YNxclrbBDj

    Where are you seeing the second one?

    #1372467
    Andrew

    Hi Leo

    Thanks for the reply.

    If you look at the source code for the home page (right click, “view source”), and then search for the following string “<h1″ (by doing ctrl-F), you will see that it appears twice. The first one is inside <div class=”site-branding” and the second is inside a <div class =“navigation-branding”

    Thanks.

    #1372479
    Leo
    Staff
    Customer Support

    The navigation-branding one should only show on mobile in the mobile header.

    #1372486
    Andrew

    Ah ok, thanks for your help. It was giving me an error in ahrefs site audit but I guess it’s nothing to worry about?

    #1372491
    Leo
    Staff
    Customer Support

    I’ll mention it to our team and see if it can be improved.

    Thanks for pointing it out 🙂

    #1372516
    Andrew

    Ok thanks Leo. Can we leave this open until we get feedback from the rest of the team?

    #1372687
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    This is a tough one, as there is a desktop header and a mobile header. We *could* remove the H1 from the mobile header, but that means mobile devices won’t have an H1 on the page.

    Since the headers never appear at the same time, I think it’s a non-issue. Even Google says that multiple H1 elements per page isn’t an issue:

    https://webmasters.stackexchange.com/questions/65452/is-it-acceptable-to-repeat-the-same-h1-tag-for-desktop-and-mobile-browsers-in-a

    #1373696
    Andrew

    Hi Tom

    Thanks for the reply. I think we can close this. 🙂

    Cheers.

    #1374050
    Tom
    Lead Developer
    Lead Developer

    No problem! 🙂

    #1422426
    Mohamed

    I faced some issue and I think it’s easy to fix by using this method
    (wp_is_mobile()) ? $showH1 : $hideH1 ;
    But how to use it with generate_site_title_output ?

    #1423095
    Leo
    Staff
    Customer Support

    Any chance you can link me to the page in question so I can see your current setup?

    Feel free to open a new topic so you can use the private URL field.

    Let me know 🙂

    #1423122
    Mohamed
    #1423144
    Leo
    Staff
    Customer Support

    Thanks!

    We will take a look.

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