h1 and h2 tags in my wordpress theme

Status
Not open for further replies.

xandor

Active Member
209
2011
21
0
I would appreciate some feedback about my ideas of improving my SEO with my wordpress theme.
The way my website works now is: add my site name to the google search and my ranking increase to first spots, otherwise it is possible that I aint on the first 5 pages.

I am currently using zDark as my wordpress theme becouse I like the look of it.

I think that it severly harms my google ranking though becouse it has h1 tag as site name, h2 tag as site description, h2 tag as post name etc.

Here is what I found when checking the theme:
Code:
header.php
<div id="header-title">
    <h1>||||<a href="<?php echo get_settings('home'); ?>"><?php bloginfo('name') ?></a></h1>
    <h2><?php bloginfo('description'); ?></h2>
</div>
Code:
comments.php
<h2 id="comments"><?php comments_number('0', '1', '%' );?> Responses.</h2>
<h2 class="nocomments">Comments are closed.</h2>
<h2><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></h2>
Code:
sidebar.php
<h2>Categories</h2>
<h2>Archives</h2>
<h2>Tag Cloud</h2>
<h2>Recent Posts</h2>
Code:
index.php
<div class="postinfo">
    <h2><a href="<?php the_permalink() ?>"><?php the_title() ?></a></h2>
</div>
Code:
single.php
<div class="single-title"><h2><a href="<?php the_permalink() ?>"><?php the_title() ?></a></h2></div>
Code:
functions.php
<?php if ( function_exists('register_sidebars') )
 register_sidebars(array(
        'before_widget' => '',
        'after_widget' => '',
         'before_title' => '<h2>',
        'after_title' => '</h2>',
    ));
It is also h2 tags in archive.php, search.php but think these 2 might be irrelevant since it is only when searching / viewing archive.

Should I rewrite or switch theme?
If I rewrite I think I should:
Remove h1 and h2 in site name and description. (This would look really bad though. Should try replacing it with a image instead of text "logo")

I should probably also remove the h2 tags from comments.php, since it is no purpose to rank for the text they show.

I should also change so my post titles are h1, is that single.php or index.php?

It might be good to remove h2 tags from sidebar.php and functions.php also, not sure though.
 
10 comments
Only add h1 tag to index.php. If you want you can add h1 tags to every post in single.php, but it will not look good.

I suggest dont remove anything, just add h1 tag to index.php. I dont know if the site will look ok, but its a good idea to have h1 / h2 tags on your page.

Add the h1 tag here:
Code:
index.php
<div class="postinfo">
    <h2><a href="<?php the_permalink() ?>"><?php the_title() ?></a></h2>
</div>

Remove:
Code:
<a href="<?php the_permalink() ?>"><?php the_title() ?></a>

And add your h1 tag. Make sure you add 3-5 primary keywords in the h1 tag!
Code:
<a href="SITE LINK - [I]if you promote something[/I]">Keyword, keyword, keyword!</a>

If you don't want a link to another site remove:
Code:
<a href="SITE LINK - [I]if you promote something[/I]"></a>

And make sure you add H1 not H2
 
I suggest u use an h1 tag for the sitename in index.php, h2 tags for the posts.
then use the h1 tag for the post's title in single.php, then change the sitename's tag to <p>
 
Use your logo as the H1 tag and hide the text with css, here is how:

<h1><a href="/">keyword, tiltle or w/e you want.</a></h1>

h1 a{
background:url(/path/to/logo.png);
display:block;
text-indent:-9999px;
}
 
Wont it cause problems if it is multiple h1 tags on the page? (Think I read that it should only be 1 h1 tag, would also remove SEO value of the most importmant keywords, the post, I think)
Also, why would I remove:
<a href="<?php the_permalink() ?>"><?php the_title() ?></a>
Isnt that: 1. A link to the post, 2. The name of the post.
I think it is on the page of the post, so the url feels kinda irrelevant, but think I cant change the post name to a static text, that would ruin the entire thing.
If I understood this correctly.

I suggest u use an h1 tag for the sitename in index.php, h2 tags for the posts.
then use the h1 tag for the post's title in single.php, then change the sitename's tag to <p>
I dont know how to change sitename to <p> when viewing a post, becouse it is in separate files.
 
Last edited:
use h1 for your site title on index.php
use h2 for your site description on index.php
use h3 for your post list on index.php

use h1 for post title on post page
use h2 for post description on post page


on category,archives,tag pages

use cat name etc as h1,description as h2.
this was what i used back in the day
 
sceneguy
Wont it cause problems if I use multiple h1 tags?

Also how do I change between <h1> and <p> for site title?
Dont get how I specify that it change when in a post, since it is written in header.php. Do I move the code for showing sitename into the other files? index.php and single.php?

Btw, really appreciate the feedback I get in this thread, usually not this awesome.
 
i think you have to use if else
i dont how to do it.i got it done from a expert.i`ll ask him to give me the code(be ready to take no for an answer)

the basic idea is here is you want traffic on your individual posts rather than on homepage.

google does not like it when content of h1 tag is same everywhere.it thinks you are spamming those few keywords in the header.i`d suggest you place an image for your header and put your site description as the alt text.
in the index.php place your site title and desc as h1 and h2 above the place where your posts are listed.

apply similar logic to cat,tag,archives.
 
EDIT: Found a blog post about how it is done.

Was a post about it here:
Code:
http://www.fathomdelivers.com/blog/index.php/wordpress-seo-secret-switching-post-h1-h2-tags/

Only problem I have now is that I cant find how to make my title pretty again xD
 
Last edited:
Status
Not open for further replies.
Back
Top