Today we are talking about the actual code of the page. We will be touching on two points.
First, lets give a little background to what are tags and why they are important. Think about it when you’re ready a book or a magazine. When you see a small excerpt, your eyes will almost always glance there first to see what it’s saying. Maybe in a newspaper there is a head line title that really catches your eye and draws in your interest.
This is exactly what Header Tags (H tags) are meant for. When a search engine bot is looking at your page, it looks for the H tags (<H1>, <H2>, <H3>, <H4>, etc, up to H6) to find out what exactly is important about that page. So what can you do to emphasize these tags on your pages? I use some PHP code to fool around with how the tags are placed on my pages.
The H tags are important starting with the lowest number, making the H1 tag the most important.
In my header, I use code like this to move around the H1 tag:
<?php if ( is_home() ) { echo "<H1>"; } else { echo "<H2>"; } ?> <a href="/">Google Inside.</a><?php if ( is_home() ) { echo "</H1>"; } else { echo </H2>"; } ?>
When I’m using that code, I put the title of my blog within the H1 tags for the homepage and only the homepage. Then for single pages, I put the H1 tag around the actual title of the page (what the page is actually about).
Take a look: my homepage with only one H1 tag (view source) and then a page with the title as an H2 tag (view source).
It’s generally a good idea to have only one H1 tag per page. For H2, H3, and so on, I like to keep it to the follow: H1: one; H2: two; H3: five; H4: 10; H5: 15; H6: 20. That way the bots don’t get overwhelmed about what the page is about.
Meta Tags
Now for meta tags. Search engines used to base search results almost purely on their meta tags, but that has since changed quite a bit. Webmasters started cheating and using meta tags that didn’t have any relevance to their pages so the search engines changed how they ranked the pages. Meta tags are very old, but I feel they are still useful.
A lot of blogs simply let the search engines figure out what to put for the description, but I feel it’s important to be able to control what visitors see in the search engine results.
I use a plugin called Another WordPress Meta Plugin. What it does is it lets you input custom values for both the keywords and the description for each post. Yes, it does add to the amount of time you spend on each post, but I feel it has helped my ranking positions quite a bit by doing that. The plugin is fairly basic to use and doesn’t require anything out of the ordinary.
If you have a plugin that you find useful for the meta information, please comment about it and I’ll see about adding it to this post. There are a ton of meta tag plugins out there, but the one above is that I’ve had experience with and it works for me (using WordPress 2.1.2)
Thanks for your information. Nice article. Maybe I will translate it into my language Indonesian, if you don’t mine
I still need to play around with my headlines and I hadn’t thought of adding some logic to them
Yahoo still use meta tags, Adsense might use them for relevancy, and the title / description can be used in snippets by all the search engines.
Is there any basis for the numbers of header tags stated in this article or is this just your personal preference/belief?
Specifically is there anything from the search engines themselves that recommends sparse use of the header tags?
Here are some official references for headings
http://www.w3.org/TR/html401/s.....ml#h-7.5.5
http://www.w3.org/Amaya/User/H.....dings.html
It should also be noted that heading styles can look totally different when viewed in an RSS readers, which is why I only use H3 or lesser tags in the body of my articles. If you change article headlines to H1, then semantically sub-headings should be H2, which then might not look very appropriate in feed readers.
http://andybeard.eu/2006/12/he.....blogs.html
Thank you for the links Andy and yes, you are right with the RSS reader.
But since this is an SEO tip, it’s focusing on the search engine aspect of the blog, not specifically the viewer in mind with their RSS reader 🙂
Just something I noticed, you didn’t use headlines for “header tags” and “meta tags”, but for some reason ” 5 Comments | Leave a comment | Comments RSS” is H3
You might find that strange, but then Problogger.net still has those as H1 e.g.
“Written on March 1, 2007 by Darren Rowse :: 158 Comments :: Bookmark on del.icio.us”
My own blog is nowhere near perfect currently, because I should remove H1 from the “NDY BEARD” and my meta tags are all over the place, on the todo list. I had some plugin problems when I upgraded to 2.1 and still haven’t got everything fixed yet.
I use
the_excerpt
(WordPress template tag) for the description meta tag and tags from “ultimate tag warrior” as keywordsAll good stuff here. Completely agree that number one is well-formatted content (an H1 for the page, H2s for major sections, etc.). Not only does it help SEO but it makes your feeds more intelligible, and it helps to make sense of the page for people w/o images/scripting/etc. (e.g. screen readers).
Also, I started using UTW keywords, and added those keywords to the tail of my default meta keyword info and it has resulted in a significant improvement in my google rankings. I’m finding my pages on topics I write about in the first page of google results quite frequently now.
Andy–
My current theme is not optimized yet. I’m currently working behind the scenes on a new theme which will be more feature-rich and a lot more SEO’d.
Hey, I have developed a meta-tag plugin for wordpress as well. What it does is it allows you to enter the meta-tags, moreover it adds dynamic metatags for each page, based on the categories you’ve specified
Meta Tag – WordPress Plugin
Andy, thanks for posting the links, but none of them have anything to do with SEO and headers or number of headers in a given page. I’m not terribly concerned with feed readers since I don’t offer full feeds on my sites, nor do I plan to.
@Jonathan again,
I’ve never run across anything suggesting that a large number of headers in a page will throw off or affect search engines in any way shape or form before this particular article.
I’m not trying to be accusative or anything, but I would like some sort of actual evidence that would lend credence to the
in the original post.
Is there anything concrete, whether it be information from the search engines (some sort of documentation you could point us to), or someone who has done some testing of this to see how it affected SEO and indexing of pages, or is it just personal opinion?
The vast majority of WordPress themes use a ton of header tags. Most of the sidebar items for WordPress themes use H2 or H3 for each item, for someone with a lot of sidebar items than can easily mean having 20-30 headers on a page (especially if you display a large number of posts on the top page and each of the post titles is also set as a header, which is also very common in WP themes).
So, something concrete or at least something to let me know that this is only your opinion/belief would be helpful as all of the themes I use would have to be reworked to remove header tags.
it’s useful
Ttancm, I have done studies on the header tags and whether or not they adversely affect traffic and they actually do. Others have confirmed this. But this article comes to you as is, take it or leave it at face value.
Can, how does it pull the description? I may consider switching if I see it to be beneficial.
Excellent article, thanks for the information!
@felipe.lavin : How are you using “the_excerpt()” outside The Loop? I thought at first “what a great idea!” but can’t quite figure it out.
I’ve never studied the WordPress API, and I’m sure it’s something to do with adding actions to the_head() or what-not, but I’ve only learned that within the last 10 minutes.
Can anyone point me in the right direction to learning how to manipulate values that get spit out during the_head() or how to adjust meta-keyword and meta-description values?
Thanks!
Actually, wouldnt it be nice if there would be a plugin which would in time collect all tags given to a blogposting permalink (e.g. from stumbleupon, del.icio.us, etc..etc..) and then just show them on your blog?
Jonathan,
When you enable automatic mode for my metatag plugin, it pulls the category name associated for the page. It doesn’t do for the main page.
@Jonathan,
I was really wondering about this because as I said, most WordPress themes use a ton of heading tags by default. I have dug around for a couple of hours and I can’t find anything that shows that the heading tags should be limited to the small numbers you mention, except for the H1 tag, which people are divided on.
For the H1 tag, Google has at some point actually given more weight to items labeled with it, but no one knows for certain whether it still does. There are even people who suggest using only H1 tags styled to look different with CSS for the SEO benefits (although this is a bit too “black hatty” for my tastes).
Otherwise, without any concrete backing, I’d have to disagree with your numbers. For WordPress in particular, H2 tags are usually used for the titles of individual posts, and whereas this isn’t generally a problem that needs discussing on the individual pages for those posts (since there is only the one post, and thus only the one h2 heading, unless your sidebar items use h2 tags), on the main index (assuming you use the default index and not a page), and often the archive and category pages you can end up with any number of h2 headings on a page depending on how many posts you have set to show per page, and remove the h2 tags from the post titles is not, in my opinion, going to improve your page rank.
Your post has made me wonder about the reasoning behind using the heading tags for sidebar items however. Even putting aside the SEO issues, I wonder how valid that really is from a design/structure POV.
@Almost George: actually, there’s nothing special with the way I do it. Here’s what I use on header.php:
<?php if (is_single()) { ?>
<meta name="description" content="<?php the_excerpt_rss()?>" />
<?php } else { ?>
<meta name="description" content="<?php bloginfo('description'); ?>" />
<?php } ?>
I use
the_excerpt_rss()
just becausethe_excerpt
puts paragraph tags around the textI figured on using *_rss for the plain text, what confused me is that it’s being used in header.php … isn’t that outside “the loop” in wordpress? I don’t doubt that you have it working, I just don’t want it to break on a future update or some such, since the docs say that the_excerpt* and the_content* have to be used “inside the loop”.
Or is it that single() pages are somehow completely generated inside the loop?
I guess I just wonder why it works, and I don’t want it to break in the future.
The reason I like to limit things is because if a search engine sees 2, 5, or 10 H1 tags, it’s not going to have a freaking clue what to emphasize. If you have just one H1 tag, it’s going to know exactly what you want it to think about the page. That’s why I limit the usage. It’s to help emphasize and prioritize the importance of what’s actually on the page.
I guess that’s because it’s only used on single pages… anyway, I’ve used for over a year on two different themes and I haven’t noticed anything broken
Great information! One point I want to add is that don’t use the exactly same sentence in the title tag and the ‘H’ tag. Once ay re-arrange the words but using the same words in same order would make it too obviously SEO done.
this is all great information. i like to reseach fellow blogs and give some of my input. the another wordpress seo plugin is a great plugin to use. i have not installed on my blog yet but it is soon to come. great post, thanks.
This a very great information Sir! And I agree with your view. Other SEO disregards the meta tags and sometimes don’t include it or apply it to their websites. Header tags or H tags and metas are still part of the optimization process. In which I think must not be disregarded… 🙂
Mmh I know this is a very old post, but I was looking for a way to get get_the_excerpt() working on header.php (thus outside the loop) and Google found this great article for me.
@felipe.lavin suggestion always returns a blank to me under WP 3.2; I’m using a slight variant of it (using is_singular() instead of is_single() to also catch pages). Clearly there is some extra trick to make it work outside the Loop.