• I searched the forum and see this topic has come up in the past. My SEO plugin is telling me there are more than one H1 tags on my pages. One is in the sidebar the other is the page title. In other themes I have, the page title has a box to check to not display the page title. This usually solves the issue if there are only 2 H1 tags. I’m assuming there is not much to do about it since there isn’t an obvious way to eliminate one of the tags.

    I’m curious about Author Pro. Would this be the same case with the Pro version or is there a way to eliminate more than one HTML tag on the page.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Ben Sibley

    (@bensibley)

    Thanks for using Author!

    Author uses HTML5 markup and in this case, the use of multiple h1 tags is correct because they both belong to different contexts on the page. Unfortunately, the HTML5 spec was made so confusing that most people seem to have abandoned it and SEO tools never read it correctly.

    If you’d like to use a single h1 tag, the best way would be to remove all of the heading tags from the sidebar. Then the document outline would be based purely on your articles instead of including the sidebar as well.

    To do this, you can start by downloading an author child theme here: https://support.competethemes.com/help/child-theme-author/

    Then copy the sidebar-primary.php file from Author into the child theme and delete line 3: <h1 class="screen-reader-text"><?php _e( 'Sidebar', 'author' ); ?></h1>

    Lastly, copy and paste this function as-is into the child theme’s functions.php file:

    function ct_author_register_widget_areas() {
    
    		// after post content
    		register_sidebar( array(
    			'name'          => esc_html__( 'Primary Sidebar', 'author' ),
    			'id'            => 'primary',
    			'description'   => esc_html__( 'Widgets in this area will be shown in the sidebar', 'author' ),
    			'before_widget' => '<section id="%1$s" class="widget %2$s">',
    			'after_widget'  => '</section>',
    			'before_title'  => '<div class="widget-title">',
    			'after_title'   => '</div>'
    		) );
    	}

    Those steps will remove all headings from the sidebar so you only have one h1 and don’t get errors about h2s showing up before the h1 tag.

    Thread Starter jg100

    (@jg100)

    Hi Ben,

    Thank you for the reply. So would Author Pro work in a similar way. It would still need the child theme.

    I’ll look over the instructions and see if it’s something I want to attempt. No sense for me making it worse.

    Aboutthe HTML5 markup. If I go to Show Page Source in Safari, the doc type says simply HTML. <!DOCTYPE html>

    Theme Author Ben Sibley

    (@bensibley)

    Right, forgot to explain that bit! I’ve made Author Pro a plugin so you don’t have to worry about switching themes. You just activate the plugin and all of the features will be added. You can continue using the same child theme.

    And that is the standard doctype declaration for HTML5: https://dev.w3.org/html5/html-author/#doctype-declaration

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘2 H1 Tags on the Page’ is closed to new replies.