Ultimate Guide to WordPress SEO – Optimized Heading Tags

Last year I read an article at Chris Pearson’s website that absolutely changed the way I looked at markup standards and WordPress SEO. Seriously, up until that point, I was convinced that SEO was a bunch of garbage for blackhat guys who were looking to game the system and cheat the rest of us. But after reading that article, I came away with a new perspective — Your markup is not simply a method for adding structure to style, but was the primary method search engines used to parse your content.

That day, I stopped using H2 in the sidebars of blog. I stopped using H1 for my blog’s title (and the blogs I would have the privilege of developing). And that’s what we’re going to cover in this post — how you can do the exact same thing!

I understand that for most of you, hacking your WordPress theme up isn’t an option; you simply don’t know enough about it to modify it without fear of seriously screwing something up. So yes, in this post, I am speaking primarily to developers and people who are relatively comfortable editing theme files. If that’s not you, then while this information may be useful to you, it probably doesn’t have any practical value, at least in the short term.

Understanding Structure

Yesterday, I mentioned that the most important content in your pages markup is what text falls between the <title></title> tags, and following in a close second is what falls between <h1></h1> tags. H1 is an HTML tag that means “Header 1” or “Primary Header”. Likewise, H2 means “Secondary Header”, and so on for H3, H4, etc., all the way up to H6.

So, it makes sense that search engines would look to the HEADINGS of your page content to determine, very quickly, what the content of the page consists of.

And if you don’t understand, and leverage, that fact, then you are putting yourself at a severe disadvantage from an SEO perspective.

Only use H1 Once

Let me make one thing clear: the H1 tag should only be used ONCE on any given page. There is no such thing as two “Primary Headers”. You may disagree with me on this, but I am convinced that using the H1 multiple times on a page will affect your SEO adversely.

That means that all you developers and bloggers out there who have your title or logo (via the image replacement technique) being served up in H1 tags — you need to get rid of this, now. Think about it, if you’re blog title is being served up in H1 tags, and the title of your post is being served up in H1 tags (which it should), then what is the primary header?

TITLE and H1 Content Should Match

Although they don’t have to, it makes sense that if you are properly structuring your TITLE with your targeted keywords, then putting double emphasis on that by having it in both the TITLE and the H1 will only serve to further communicate to search engines that your content is important.

H2 Is for Sub-Headings

and it makes perfect sense to have multiple subheadings. In fact, you may notice that the subheadings I used in this blog post are being served up in H2 tags. Should you be stuffing H2 tags with keywords? You probably could, but as with any of the SEO methods I’ve outlined in this series, don’t force it.

Sidebars and the H2 Tag

It is a sad fact that, by default, WordPress serves up Widget titles within the H2 tag. This is so completely counter-intuitive for semantic, structured markup. Do you really consider the titles of your sidebar widgets to be important information? No. Of course not.

For tips on getting your Widgets to use a different heading tag for titles, check out this tutorial by Automattic. I’ll also write a more detailed tutorial in the future for MAXIMUM control over the look and feel of widgets in themes.

Everything Else

From H3 to H6, it’s really just a matter of using the tag you think represents the importance of the content you’re wrapping the tags around. For instance, I choose to use the H3 tag around my sidebar and widget titles. I think it makes good sense, but you may have some content that you think is more deserving of the H3 tag and choose to use the H4 tag for widget titles. It’s really up to you.

Practical Application

I know I’ve been speaking in mostly theory in this post, but really, if you’re a developer, you probably already know how to apply this information in a WordPress theme. But generally, here are some good places to look:

  • To remove the H1 tag from the blog title or logo, look in the header.php file.
  • To remove the H2 tag from the widgets, you’ll want to modify the widgetization code in functions.php.
  • To use the H1 tag as a single post or Page title, check out single.php and page.php.
  • To use H2 tags in single posts or Pages, use the HTML editor or use the extended WYSIWYG options

Hopefully this has been helpful. Tomorrow, we’ll finally get into some advanced stuff that will give you an advantage over most of your peers. Don’t miss it!

Reader Interactions


  1. Nathan, thanks for posting this. I’ll admit that I’m guilty of not paying as much attention as I should to the tags but your article has spurred me to correct this.

  2. Interesting. It is very useful to be reminded of this kind of thing from time to time, especially as I am still working on my new theme.

    How do you feel about the one h1 point when it comes to archive pages? I can see arguments two ways, the page is indeed called archives, or whatever derivative of that makes sense, but then each post is a separate piece of content, and maybe a completely different topic.

    • Are you trying to make these pages stand out? That is to say, are you trying to optimize the page for a search engine? If not, hold on to your link juice ;)
      If the pages are that hot, I would keep the content fresh and the spiders happy.

  3. Like the above poster I also saw your comment on problogger – glad I stumbled across this article, there is a lot of useful information to be gained!

  4. Hi Nathan, I have been reading your daily posts this week, and they are really good. Thanks for sharing your wordpress knowledge…one more reason to your WP themes!

  5. So if you are saying not to wrap the Blog Name in h1 tags, but rather the Post/Page Name, then are you suggesting we should wrap the Blog Name in h2 tags?

    It seems that since the Title comes first in the structure of a site (as a logo image replacement or whatever) and that google would consider that info to be the most important. I do, however see how it should not be as important as the Post title or Page title, but is that definitely the case?


  6. @Rich,
    Ideally, you could use a conditional tag to wrap the blog title in H1 tags when on the homepage, and DIV tags when on single posts and pages.

    And no, I don’t recommend H2 tags for the blog title. As I mentioned in a previous post, when viewing a single post or page, the blog title is very UNimportant. And it certainly isn’t a subheading for the content of that page. DIV tags are your best bet really. Just give it a semantic ID — something like “title” or something.

    @Chris, @HIN, @Shankar,
    Thank you so much! I’m glad you found it useful.

    On all the blogs that I develop, I wrap the “Archive for blah, blah” in H4 tags. But then again, I also don’t recommend having search engines index your category archives. :-)

  7. Nathan, before I found your blog and the Itheme video tutorials I bought the Revolution City theme. Now that I am doing tons of research and slowly customizing the new site I want it optimized as much as possible for SEO.

    What is the best way to remove the tags from the sidebars? I went into sidebar_left.php and changed all of the tags to tags, then I changed the #sidebar h2 in style.css to h4
    I didn’t have to touch functions.php at all.

    All appears to work well except for the Admin “Meta” in the sidebar. The text in that section is bold, upercase and centered. As a newbie I am having a hard time figuring out where it’s pulling that text from.

    The php command in sidebar_left.php that’s right above Admin that is now Admin is this

    The font in this section for the urls is pulling from a different source than the Categories, Archives and Blogroll section is. I read the Codex regarding “Template Tags” but I am having a hard time finding the “Admin Meta” file or locating it in the Admin Panel so I can fix it, remove it or reduce the number of links in it from 4 down to just 1 login link.

    If you can help, that would be great. Thanks!

  8. Tags also you could use for social bookmarking and SEO. But the problem of popular social bookmarking is not publish a site if not enough traffic. Try to use the below social bookmark which is easy to publish blogs or webs!

  9. What you’re saying makes sense, but I was looking at your proximity theme and your sidebars are H2’s and you have words like “Comments” and “Leave a comment” as h4, why bother optimizing that at all?

  10. @Daniel
    You’re absolutely right about Proximity. It’s getting a little update love very soon, and those very very naughty H2s in the sidebar and section headings are going away to be replaced with H4s.


  11. I really never knew that about H1 and H2 headings and how they can really make a difference for a website. It’s actually eye opening. Thanks for sharing that info with us.

  12. Hi Nathan,

    I’ve been asked by a client to fix an issue with how their site’s name shows up in Google searches and wondering if you might have some insight? They want the site to show up as “The Law Office of Michael B. McCarthy” in search results, but, since they also wanted the blog name in the header to show in two different sized fonts, I tried using h3 tags for “the law office of” and then h1 for “Michael B. McCarthy”. (http://michaelmccarthylaw.com). Now, when their site comes up, the top link is just titled “The Law Office of”. Is this due to the difference in the tags used in the header.php?


    • Yeah mixing the h tags like that is probably not a great idea. I think that you could wrap everything in ‘H1’ tags, and then “the law offices of” in ‘span’ tags and then use the css declaration ‘h1 span’ to reduce the size or whatever. That way the entire name is still concentrated on.


  13. Hi Rich,

    I tried the span idea and while it did work on the blog’s name, it created havoc with the site in IE (big surprise). The client has done a lot of pasting in content from a Word doc which is full of span tags. I decided to enclose it in just H1 tags, then use the width declaration to separate it into two lines. Hopefully that will work for Google as well as the client!


  14. Hello,

    An additional point. I don’t know whether this is true or not, but some SEO experts maintain that implementing sufficient variation in your formatting is important to SEO results. In other words, if a few of your META tags are bolded in your body text, this may help you gain PR. But if the entire page is bolded, then the advantage goes away, since the bolding is considered the standard format for the page by the search engine.

    Again, I don’t know if the above is true, and if it is true, it may only apply to certain search engines.

  15. I don’t think so, Google is really looking our Meta information on every pages. May be its is really deny the Meta tags. But Heading tags are really worth full. Google like that….

  16. Good post. Now I was wondering, if I want to create my wordpress content using pages, not posts, is it still possible to have h2 tags? I dont think that subtitles in pages end up being in H2 tags, when I check my source code… (and yes..newbie here ;-)