Custom Header Tag for WordPress

Follow @tristarweb

As brilliant as I think WordPress is I do feel that there are a few features that do need to be addressed. One of the big areas of SEO that I feel WordPress lacks is the simple ability to use custom H tags (H1, H2 etc…), I’m hoping that this might be addressed in the new 3.0 version of WordPress soon to be released.

The H1 tag is arguably a very big part of SEO when it comes to inserting keywords into a web page so surely it makes sense to be able to choose what the tag itself says.

With the help of the custom fields however there is an easy way:

Find: (in your page.php for example)

<h1><?php the_title(); ?></h1>

And replace with:

<h1><?php $thisPost = $post -> ID; if  (get_post_meta($thisPost, changeH1, true) !=null)
{ echo (get_post_meta($thisPost, changeH1, true)); }
else { the_title(); }
?></h1>

Next open up the page where you would like the custom header and in the ‘Custom Fields’ section enter the following details:

Name: changeH1
Value: Whatever you want!

Et voilĂ , you can now have any H1 that you need. This is very useful for SEO reasons … Trust me!

About Gav Hoffman

Hi, I'm Gav and I try to make sure I am living life as much as possible and loving every minute of it. Designing and developing on a daily basis And lover of all things creative.

4 Responses to Custom Header Tag for WordPress

  1. Orlando Web Designing says:

    10:23 19/11/2009

    Thanks for your information. Please keep posting more tips for word press sites.

  2. James says:

    13:57 19/11/2009

    No problem, as soon as I have more tips I will add them. I hope they help =)

  3. Nick says:

    11:00 01/12/2009

    Not so much a comment about WordPress but about Header tags; whilst I’ve never doubted their use as a structuring tool for web design, I am still not convinced that for SEO purposes their use is essential.

    Bing certainly takes more notice of them more than Google, and in fact it appears that Google may be ignoring certain H tags due to their overuse by dodgy webmasters.

    An interesting article I came across this morning, not sure if I can do a linky so you’ll have to copy and paste:
    http://www.webproworld.com/google-discussion-forum/95014-main-differences-optimizing-google-compared-other-ses.html

  4. Wordpress Installation Service says:

    08:03 18/08/2010

    Very helpful information. I’ll give it a try then. Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please wrap all source code with [code][/code] tags.

Follow Tristar on Twitter