• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Technostarry

  • Home
  • Windows 8
  • Android
  • iOS
  • Web Apps
  • Web Browser
  • Hardware
  • About

How to Add H1 tag in Homepage in WordPress

April 16, 2011 by Saqib 3 Comments

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.

Filed Under: WordPress

Reader Interactions

Comments

  1. Kostas Pap says

    December 25, 2011 at 12:58 am

    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

    Reply
    • Saqib says

      December 25, 2011 at 12:06 pm

      You’ll need to enter the complete code and not just one line. Also you need to add this code in header.php file.

      Reply
  2. Nikoncoolpixreviews says

    July 19, 2011 at 1:55 am

    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!!!!!

    Reply

Leave a Reply Cancel reply

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

Primary Sidebar

STAY CONNECTED

  • Facebook
  • Google+
  • RSS
  • Twitter
  • YouTube

SUBSCRIBE

Subscribe now to get the latest updates from this blog right to your Inbox

Recent Posts

  • 6 Things to Remember Before Buying a Micro SD Card
  • 5 Best Android Stock Market Apps for India
  • Facebook App Alternatives for Android , and Why You Should Use Them
  • Kindle Oasis vs Voyage vs Paperwhite: Which one to Buy

Footer

Links

  • About
  • Subscribe
  • Contact
  • Advertise
  • Privacy Policy

Books on cloud storage services:

  • Mastering OneDrive And Office Online
  • Mastering Google Drive and Docs (With Tips)
  • Mastering Dropbox with Useful Tips and Apps

Must Read Articles

  • How to Change Default Apps on Android
  • 6 Tips to Increase Battery Life on Android 4.4 KitKat Devices
  • How to Transfer Documents and Files to your Kindle
  • 5 Best Free Offline Dictionary Apps for Android

© Copyright 2016 Technostarry · All Rights Reserved ·