Drupal Has Multiple h1 Tags

Older versions of drupal used the h1 tag for the site logo and h2 tag for the page title. Since h1 is one of the most important tags for SEO, the drupal community lobbied to get rid of the h1 for the logo and to change the h2 tag in the tag to an h1 tag. But, I have just noticed that there is a situation where Drupal has multiple h1 tags!

I hadn't noticed this before since the themes I've used for sites I've built have always been custom so we've had ultimate control of the header area. But, if you use the Bluemarine theme, like I am here, and use a "site name", like I'm doing here (the text "Kristen Pol" at the top of the site), then you will have two h1 tags on your page.

There are other themes that have the h1 tag in the header area as well. Bluemarine, chameleon, and marvin use it for the site name. Garland and minelli use it for the logo, site name, and site slogan (all together). Pushbutton is the only drupal theme that does not use the h1 within the header area.

There is a controversy as to whether multiple h1 tags are good or bad or neutral for SEO. It seems that it may make sense to have more than one h1 in some cases. But, if you were to use multiple h1 tags, you would want to create each one yourself so you had complete control over what was in them. And, you'd want unique h1 tags as much as possible.

Since the "site name" h1 is showing up throughout the entire site and isn't really relevant to most of the page content (except perhaps my resume page or drupal programmer page) then it I imagine it is HURTING my SEO.

So, what can I do?

Since Drupal has multiple h1 tags, I will modify the Bluemarine theme (as a custom theme - not in the core) and get rid of the h1 tag myself. Here is my post for how to customize a drupal theme.



Thanks for the Post

Hey thanks a lot for sharing such a nice and informative article,

Footers are of two types(as of now.)
1 – The traditional small text footers(like you see here) mostly with the copyright text and a few email links etc.
2 – The bigger,evident web2.0 style footer text with category links and content.

If you have the first type of footer – nothing wrong.In fact it’s easier to tweak to a crawler and get our stuff done.But if you have the second type of footer(web 2.0 style), then you have an advantage – you attract the crawlers as well as human visitors – the golden rule of SEO!

Thanks for the Post

Hey thanks a lot for sharing such a nice and informative article , really a very nice and detailed review which is very helpful.
By the way for more information on Seo Tips and Tricks check this link: seo tips and tricks

you could us this bit off

you could us this bit off could in a custom views tpl.php file there is prob an easier way to do it but this works really well:

$str = preg_replace('#(<h1.*?>).*?(</h1>)#', '$1$2', $rows);
echo strip_tags($str, '<a> <div> <p> <h2> <h3>
 <span> <img> <strong> <em> <table> <td> <tr>
 <th> <tbody> <center> <ul> <li> <ol> <font> 
<blockquote> <br> <fieldset> <input> <textarea> <tfoot> 
<thead> <button> <form> <h4> <h5> <h6> <label> 
<pre> <select> <sub> <sup> <tt>');

the first part removes the txt in the h1 tags and the second part removes all unwanted tags, the tags listed are what i want to be left in the view teaser so if there is any tags u want removed from your views teaser pages then just delete them from the code.

if u are using it with anything other than views teasers then all u have to do is replace the $rows string and then place it in anouther .tpl.php file for the module u are using.


Seo header tags is the major part in seo. It is recommeded to use atleast one h1 tag in the page. And if you use that heading tag for the targetted keyword. The page will get optimized quickly. This is an important factor in onpage seo.


My understanding is that it is best to only use one h1 tag rather than multiple. Using multiple h2 tags is fine.


I'm a Speaker at DrupalCon Portland