WordPress.org

Ready to get started?Download WordPress

Forums

Remove site-title h1 tag in Twenty Twelve Theme (7 posts)

  1. pugh
    Member
    Posted 1 year ago #

    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?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    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.

  3. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    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)

  4. pugh
    Member
    Posted 1 year ago #

    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.

  5. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 1 year ago #

    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?
    http://www.youtube.com/watch?v=GIn5qJKU8VM

  6. pugh
    Member
    Posted 1 year ago #

    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.

  7. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic