It is said that if content is the king, then SEO (Search engine optimization) is the queen. Some of you may agree and some may not also, but you would definitely like to check if proper heading tags are used in your theme’s development. Proper use of heading tags are very important for SEO point of view. Search engines give more value to header tags when examining a webpage. The highest weight is given to <h1> tag, thus it should be a post title in detail page of your WordPress and it should be Blog Name in Homepage. One should also note that this <h1> should not be repeated twice in any page. It can be said, that <h1> is used to define the main topic in a page.
Best SEO practices for WordPress theme development:
- Use <h1> as Blog name in Homepage
- Use <h3> for widget titles
- Use <h1> as Category name in listing/category page
- <h1> should be post title in detail page
Below is the procedure to add <h1> in Homepage:
Just add this code after <body> in header.php file of your theme. Before doing this, you can first ensure that if your current theme already has any <h1> tag in it, by viewing the page source.
<?php if ( is_home() ) { ?>
<h1 style=”display:none;”><?php bloginfo(‘name’); ?></h1>
<?php } else { ?>
<?php
}
?>
You need to add this code in header.php file.
What will this code do ?
Its just very simple, <?php bloginfo(‘name’); will echo the Blog name and output it in the homepage. Don’t worry, we have applied a condition that <h1> will only be applied to your Homepage and it will output Blog Title. In other pages (e.g. category and detail page), there will be no effect in of this code because of this condition.
Hope this helps you to add Header tags in your WordPress theme.
Kostas Pap says
Hi i added the code you gave for adding h1 tag in my home page. All are ok and now is recognized as h1 in the home page. But i can’t make it to be disappeared from the homepage. Take a look here in the header… you can see the title… http://www.greek-radar.gr/
Any solution?
I added : <h1.site-title{
display:none;}
in css style but nothing happened.. Please Help
Saqib says
You’ll need to enter the complete code and not just one line. Also you need to add this code in header.php file.
Nikoncoolpixreviews says
Hello Saqib,
Thanks so much for this information. Mostly I use excerpts from my blogposts to show on my homepage. The problem with this method is that I could not add an H1 tag on my homepage. My themes do not use the site title by default.
Untill Now!!!!!