• Resolved bbrody

    (@bbrody)


    Okay so I’ve heard that WordPress themes use the h1 tag poorly for seo.

    Here’s what this site (and many others) say…

    The default WordPress installation designates the blog title as the H1 tag of the page. Unfortunately it results in the same H1 title on every page.

    It is definitely not an ideal for Search Engine Optimization.
    All pages should have their own unique H1 title tags containing the keywords which the page is optimized for.

    I would like to optimize my H1,H2, ect. tags but can’t figure out how to do this. I’ve Googled for hours but every “walkthrough” I’ve found is too vague for a non programmer like me.

    How can I optimize my H1 tags like that? (I’m using the default kubrick style wp theme)

    Is that what the All-in-one Seo pack does?

Viewing 1 replies (of 1 total)
  • I use something like this:

    function generate_page_title() {
    	$o = '';
    	global $cat, $post, $wp_locale, $wp;
    	$error_message = 'Sorry, we could not find what you are looking for.';
    	if( is_singular() ) {
    		$o = $post->post_title;
    	}
    	elseif( is_category() )	{
    		$o = single_cat_title( '', false );
    	}
    	elseif( is_tag() ) {
    		$tag_name = single_cat_title( '', false );
    		$o = ( $tag_name ) ? 'Entries Tagged: "' . $tag_name . '"' : $error_message;
    	}
    	elseif( is_search() ) {
    		$o = 'Search Results';
    	}
    	elseif( is_author() ) {
    		$this_author = ( isset( $_GET['author_name'] ) ) ? get_userdatabylogin( $_GET['author_name'] ) : $curauth = get_userdata( intval( $author ) );
    		if( $this_author )
    			$o = 'Entries posted by: ' . $this_author->display_name;
    		else
    			$o = 'Author Archives';
    	}
    	elseif( is_day() ) {
    		$d = ( isset( $wp->query_vars['day'] ) ) ? $wp->query_vars['day'] : substr( $_GET['m'], 4, 2 );
    		$m = ( isset( $wp->query_vars['monthnum'] ) ) ? $wp->query_vars['monthnum'] : substr( $_GET['m'], -1, 2 );
    		$y = ( isset( $wp->query_vars['year'] ) ) ? $wp->query_vars['year'] : substr( $_GET['m'], 0, 4 );
    		$t = mktime( 0, 0, 0, $m, $d, $y );
    		$o = 'Entries posted on ' . date( 'l F jS, Y', $t );
    	}
    	elseif( is_month() ) {
    		$y = ( isset( $wp->query_vars['y'] ) ) ? $wp->query_vars['y'] : substr( $_GET['m'], 0, 4 );
    		$m = ( isset( $wp->query_vars['monthnum'] ) ) ? $wp->query_vars['monthnum'] : substr( $_GET['m'], -1, 2 );
    		$o = 'Entries posted in ' . $wp_locale->get_month( $m ) . ', ' . intval( $y );
    	}
    	elseif( is_year() ) {
    		$y = ( isset( $wp->query_vars['year'] ) ) ? $wp->query_vars['year'] : $_GET['m'];
    		$o = 'Entries posted in ' . intval( $y );
    	}
    
    	return $o;
    }

    If you paste this function in your theme’s functions.php file, you can then call <?php print generate_page_title(); ?> Where ever you want your page title to be. This function should be used outside the loop.

Viewing 1 replies (of 1 total)
  • The topic ‘Confused about wordpress h1 tag seo’ is closed to new replies.