Looking for a JavaEE Architect or Potential Tech Co-Founder?
Please don't hesitate to contact me.

How to add unique meta tags, description and keywords to blogger

Since, my google Webmaster's Tool Diagnostics always tells me that I have duplicate Short Description and Duplicate Meta Tags. I've search for solutions that will eliminate this problem. What I want is for every page of my blog there will be a unique title, keywords and description set. To achieve this I have the following code:

<b:if cond='data:blog.pageType == "index"'>
<title></title>
<META NAME='keywords' expr:content='data:blog.pageTitle'/>
<META NAME='description' expr:content='data:blog.title'/>
<b:else/>
<title></title>

<b:if cond='data:blog.pageType == "comment"'>
<META NAME='keywords' expr:content='data:blog.pageName'/><!-- I want to do something here -->
<b:else/>
<META NAME='keywords' expr:content='data:blog.pageName'/>
</b:if>

<META NAME='description' expr:content='data:blog.pageName'/>
</b:if>


This code tells us to set the keywords, title and description to the page title or pagename (this must be unique). I know it's not yet in that level to be good in SEO but at least it will eliminate the Diagnostics error.

What I want to do next is to set the keywords to blog post labels, and to add a unique description to every comment.

[edit]
Regarding labels as keywords, I was working at the loop but can't print it out inside the head tag finally I saw this blog :

url: http://www.moretechtips.net/2009/03/blogger-seo-tip-use-post-labels-as-meta.html
title: Blogger SEO Tip: Use Post Labels as Meta Keywords

And finally, I was able to do what I want :-D.

[edit]
//copied codes:

<b:if cond='data:blog.pageType == "item"'>
<b:section id='meta1' showaddelement='no'>
<!-- widget must be a of Type = 'blog' to have posts data exposed, and must have a unique id -->
<!-- Empty Includables(functions) to output nothing, You must keep them ): -->
<b:widget id='Blog200' locked='no' type='Blog'>
<b:includable id='nextprev'/>
<b:includable id='backlinks' var='post'/>
<b:includable id='post' var='post' />
<b:includable id='status-message'/>
<b:includable id='comment-form' var='post'/>
<b:includable id='backlinkDeleteIcon' var='backlink'/>
<b:includable id='postQuickEdit' var='post'/>
<b:includable id='commentDeleteIcon' var='comment'/>
<b:includable id='feedLinks'/>
<b:includable id='feedLinksBody' var='links'/>
<b:includable id='comments' var='post'/>
<b:includable id='main' var='top'><!-- Main Function of Any widget comes with ID 'main' -->
<!-- Loop Page Posts (only 1 in a post page )-->
<b:loop values='data:posts' var='post'>
<b:if cond='data:post.labels'>
<!-- If the post has labels, make Meta keywords by looping lables -->
<meta name="keywords" content="<b:loop values='data:post.labels' var='label'><data:label.name/><b:if cond='data:label.isLast != "true"'>,</b:if></b:loop>" />
</b:if>
</b:loop>
</b:includable>
</b:widget>
</b:section>
</b:if>
How to add unique meta tags, description and keywords to blogger How to add unique meta tags, description and keywords to blogger Reviewed by czetsuya on Thursday, October 22, 2009 Rating: 5

1 comment:

czetsuya said...

//Note: I copied these codes, these are only for my reference. I wonder why this code is always automatically deleted in my blog
<b:if cond='data:blog.pageType == "item"'>
<b:section id='meta1' showaddelement='no'>
<b:widget id='Blog200' locked='no' type='Blog'>
<b:includable id='main' var='top'>
<b:loop values='data:posts' var='post'>
<b:if cond='data:post.labels'>
<!-- If the post has labels, make Meta keywords by looping lables -->
<meta name="keywords" content="<b:loop values='data:post.labels' var='label'><data:label.name/><b:if cond='data:label.isLast != "true"'>,</b:if></b:loop>" />
</b:if>
</b:loop>
</b:includable>
</b:widget>
</b:section>
</b:if>

Powered by Blogger.