Archive for blogger

Adding social tech site buttons to Blogger

ObiShawn asked me how I added the buttons at the end of each post for the social tech sites. You can look at the end of this post to see what I mean.

It’s simple!

Edit the HTML for your template (Layout -> Edit HTML), click on "Expand Widget Templates". Look for this code:

<p><data:post.body/></p>

Immediately after that code, add this:

<p><a expr:href='&quot;http://www.dotnetkicks.com/submit/?url=&quot; + data:post.url + &quot;&amp;title=&quot; + data:post.title' expr:id='data:widget.instanceId + &quot;_kickit&quot;' rel='nofollow'><img alt='Submit this story to DotNetKicks' expr:src='&quot;http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=&quot; + data:post.url'/></a>
<br/>
<script type='text/javascript'>
var dzone_url = &#39;<data:post.url/>&#39;;
var dzone_title = &#39;<data:post.title/>&#39;;
var dzone_style = &#39;2&#39;;
</script>
<script defer='defer' src='http://widgets.dzone.com/widgets/zoneit.js' type='text/javascript'> </script>
<br/>
<script type='text/javascript'>
digg_url = &quot;<data:post.url/>&quot;;
digg_title = &quot;<data:post.title/>&quot;;
digg_skin = &quot;compact&quot;;
</script>
<script defer='defer' src='http://digg.com/tools/diggthis.js' type='text/javascript'/>
</p>

That’s the exact code I’m using in my template at the time of this post. It’s not visually perfect, but it works.

Optimizing new Blogger title tags for SEO

By default, the title tags that Blogger uses are less than ideal. Search engines put a lot of value on your title tags, so it’s worth taking some time to make sure that they’re set up correctly.

When I initially set up my blog, I set the title to "Young Technologies Tech Blog". Look what happened in the search results:

image

YUCK! There are two major problems here. The first is that the titles are not at all useful to a human. How would you expect anyone to click on titles like this?

The second problem is that my title tags don’t tell Google anything interesting about my site. You want the search engines to figure out the keywords in each of your pages, and having those keywords in the title reinforces that.

In "classic" blogger, you would simply use

<title><br /><mainorarchivepage><$BlogTitle$></mainorarchivepage><br /><itempage><blogger><$BlogItemTitle$></blogger> - <$BlogTitle$></itempage><br /></title>

instead of:

<title><$BlogPageTitle$></title>

This would use the title of the post item as the title of the page. The problem is the "new" blogger has a completely different template system. Be sure to back up your template before editing it! Here is what I did, step-by-step:

  • Shorten your actual blog title. I was unable to figure out how to remove the blog title from each post page, without losing the post title. Unfortunately Blogger doesn’t have a token for the item post title. For my blog, I changed the title to "YTechie.com", which I think is a reasonable prefix for my post page titles.
  • Customize the title tag in your template. Do this by editing the HTML, expand the widget templates, and put the following code in place of the existing title tag. This will allow you to have a custom title just for the front page.
<b:if cond='data:blog.pageType == &quot;index&quot;'>
 <title>Front Page Title (change this)</title>
<b:else/>
 <title><data:blog.pageTitle/></title>
</b:if>
  • In the code above, put in the title you want for the front page. Try to keep it around or under 66 characters. For additional guidelines, consult this guide.
  • Since you changed the title of your blog to something shorter, that will show up in the header as well. To customize the header text, replace this:
<b:if cond='data:blog.url == data:blog.homepageUrl'>
   <data:title/>
 <b:else/>
   <a expr:href='data:blog.homepageUrl'><data:title/></a>
 </b:if>

With this:

<b:if cond='data:blog.url == data:blog.homepageUrl'>
   This is my header title (change this)
<b:else/>
   <a expr:href='data:blog.homepageUrl'>This is my header title (change this)</a>
</b:if>

Avoiding duplicate content with your site or blog

One of the most important rules in SEO (Search engine optimization) is avoiding duplicate content. Google has some information on their page about how they handle duplicate content. Unfortunately, the Googlebot is rarely smart enough to know which content is original. Google wants to avoid users that copy and/or republish someone else’s work simply to get content for their site.

You also want Google find pages on your site that have substance, and that are not just a copy of content from one of your other pages.

image

So how do you avoid it on your site? The first step is to identify potential pages that have duplicate content. It’s probably happening without you even being aware of it.

Type this into Google: site:http://www.yoursite.com

I’m using blogger, and by default here are some pages that are indexed that should not be:

  • http://www.ytechie.com/2008/04/aspnet-linkbutton-and-seo.html?widgetType=BlogArchive&widgetId=BlogArchive1&action=toggle&dir=close&toggle=YEARLY-1199167200000&toggleopen=MONTHLY-1207026000000
  • http://www.ytechie.com/2008_03_01_archive.html

Now that we’ve identified the offending pages, we can create or modify our robots.txt file, at the root of our site.

Here is what I could add to my robots.txt to block those pages:

Disallow: /*?
Disallow: /*_archive.html$

Once you’ve updated your robots.txt file, you can use the Google webmaster tools to test it. For more information on how to edit your robots file, including syntax, consult Google.

There is one big problem. If you’re using a service like Blogger (like this blog), you can’t edit your robots file. There has been talk of adding support, but we have to deal with what is available.

The best I’ve been able to come up with, is adding this into the head (look for <head>) of my template code:

<b:if cond=’data:blog.pageType == “archive”>
 <meta name=”robots” content=”noindex, nofollow” />
</b:if>

This adds a noindex and nofollow meta tag to the generated archive pages. I have not yet figured out how to remove pages that contain parameters (?param=value). If anyone has a way to do it, please let me know! I’ve actually been considering removing the archive widget to solve it.