I enjoy simplicity, in everything. Unnecessary complexity is evil. Have a look at my WordPress plugins.

Quick WordPress SEO Tip: Appropriate Headings

Just a quick SEO tip which I feel every theme developer should implement into their themes. It only takes a few minutes and add a little more semantics to your page.

Semantics..

When a search engine bot stumbles upon your website it will see your website without any styling. No matter how bold or big your letters are, the spider won’t look at those words as if they have more importance then other words. You can add meaning/value to certain words by wrapping them inside certain elements. Let’s say your website contains a grocery list, it makes sense to put those inside a list right?

<ul>
        <li>Apples</li>
        <li>Peaches</li>
        <li>Oranges</li>
</ul>

Now, regarding headings. What is most important on your homepage and what is most important on your post pages? In my opinion on the homepage the thing that’s most important is your blog’s title, and on post pages it’s the post’s title. So, why not use proper H1 tags to add some more value to your title’s?

See where i’m going to? I want the homepage title to be inside an H1 element on the homepage ONLY. For other pages an H3 element seems appropriate. On those other pages (think posts) the thing that should be wrapped inside the H1 element is the post’s title!

H1 or H3 element?

So, every time a page is loaded WordPress should check if the homepage is being viewed. If it is, output the blog’s title inside an H1 element. If not, use an H3 element. This conditional is actually very simple using WordPress is_home() function, have a look!

function qoate_heading(){
	if(is_home()) { $output = '<h1>'; } else { $output = '<h3>'; }
	$output .= get_bloginfo('name');
	if(is_home()) { $output = '</h1>'; } else { $output = '</h3>'; }
	echo $output;
}

This function will check if the homepage is being viewed, and if so outputs an H1 element. Now add this function to your theme’s functions.php file! All that’s left is to replace your current H1 element inside your headers.php with a call to this function.

<h1><?php bloginfo('name'); ?> </h1>

Becomes…

<?php qoate_heading(); ?>

Now we got our semantics covered for spiders, but what about visitors. They will most likely notice a change in header size. Easy fix here, just add a certain id to your heading inside the function we put in our functions.php file. Use this id to style the heading so both the H1 as the H3 will look the same on all pages.

function qoate_heading(){
	if(is_home()) { $output = '<h1 id="q_heading">'; } else { $output = '<h3 id="q_heading">'; }
	$output .= get_bloginfo('name');
	if(is_home()) { $output = '</h1>'; } else { $output = '</h3>'; }
	echo $output;
}
#q_heading{
font-size:20px;
color:black;
}

A little more semantics..

You’ve just added a little more value to the keywords that are important on your blog’s posts/pages and it only took you 5 minutes! Ain’t that sweet? Some people argue about the value of H1 headings vs. other words but I am a believer! I’ve noticed jumps in SERP by just using the appropriate headings on my webpages. It makes no sense using multiple H1 headings on a webpage, right? Semantics are the way to go!

Share this post: on Twitter on Facebook

2 Responses to “Quick WordPress SEO Tip: Appropriate Headings”

  1. Hi Danny, I am using a static front page for home as opposed to the blog page. Still have the blog page for posts. On my homepage (static) the blog title shows as H2 tag instead of H1. Is there a way to correct this? Right now I made the page title H1 which corresponds with the focus keyword and site title “Raleigh-Durham Real Estate” to compensate. Thanks for your input.

    • Hi Monty,

      I take it that you know a thing or two about playing with the theme files? The conditional ‘is_home()’ which I used as an example in this posts checks if the current page is the home page. However, when using static pages as your front page this does not return true. To correct this you can use the ‘is_front_page()‘ conditional which returns true when the front page is being watched, it makes no difference if this is a static front page or the normal blog page.

      Hope that helps and if not, just let me know!

Leave a Reply