WordPress.org

Support

Support » Themes and Templates » Remove site-title h1 tag in Twenty Twelve Theme

Remove site-title h1 tag in Twenty Twelve Theme

  • By default the WordPress Twenty Twelve Theme has duplicate H1 tags, which from an SEO point of view I would prefer to avoid.

    One set of H1 tags is generated by the entry-title. It is this set of h1 tags that I would like to keep.

    The other set of H1 tags is generated from the site-title.

    To solve the problem I have copied the header.php file into my child theme. I can then edit the following code to replace the h1 tag with an h3 tag

    <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>

    However, this then means that in the page source, the H3 tag is above the H1 tag, which still isn’t ideal from an SEO point of view.

    My question is, if I delete the entire string of code to have neither an H1 nor an H3 tag for the site-title, is it likely to cause any problems?

Viewing 6 replies - 1 through 6 (of 6 total)
  • esmi

    @esmi

    Forum Moderator

    Do not edit the Twenty Twelve theme. It is the default WordPress theme and having access to an unedited version of the theme is vital when dealing with a range of site issues. First create a child theme for your changes.

    And from an SEO perspective, there’s nothing wrong with the heading structure in 2012.

    Moderator Michael

    @alchymyth

    Forum Moderator

    My question is, if I delete the entire string of code to have neither an H1 nor an H3 tag for the site-title, is it likely to cause any problems?

    you can always change the h1 to a div (there is an example of that in the header.php of Twenty Ten)

    Esmi, I have created a child theme. Arguably having more than one h1 tag is a problem from an SEO point of view. I have one h1 tag on my current website, but it ranks well so I’m not going to change it just because.

    Thanks alchymyth, I will have a look at twenty ten.

    Moderator Andrew Nevins

    @anevins

    Forum moderator

    Arguably having more than one h1 tag is a problem from an SEO point of view.

    Should you really be arguing with the big boys?

    Are those the same big boys that break their own rules?

    The video is four years old now.

    Two years ago I was running twenty eleven which had duplicate tags, modified it to have single tags and had a 25% increase in traffic.

    WPyogi

    @wpyogi

    Forum Moderator

    There are many opinions on this question and no definitive answers – there are many, many factors that go into SEO. If you want to redo a theme to change the tags and CSS, go for it.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Remove site-title h1 tag in Twenty Twelve Theme’ is closed to new replies.