Showing posts with label meta tag tips. Show all posts
Showing posts with label meta tag tips. Show all posts

How to Add meta descriptions to Blogger

When you add a widget (or a gadget as Blogger would call it) to your blog, by default the widget would appear on all pages –homepage, index, archive, post and static pages. But what if you want a certain widget to appear only on a certain page or pages, can it be done? In other words can you select on which page/pages the widget would or would not appear?  The answer is yes you can -by using Blogger conditional tags.
Note: This trick doesn't work with Labels, Archive and Followers gadgets. For these gadgets you want to use the CSS's display none method.
Let us proceed,

1. Find your widget or section Id

To address a widget or a section in HTML, you need to know its Id. Here’s how to find a widget or section Id.

2. Locate the widget code in HTML

  1. Go to Dashboard > Design > Edit HTML.
  2. Check the  Expand Widget Templates check box on top right of the HTML window.
  3. Find your widget in the HTML by using Ctrl+F and entering the widget Id in the search box.
Your widget code might look like this. It may be a little different, but it’s okay. Just pay attention to the highlighted lines. Widget content is contained in between those two lines -in "includable" section.

<b:widget id='WidgetID' locked='false' title='Widget title' type='HTML'>
<b:includable id='main'>  
    <b:if cond='data:title != &quot;&quot;'> 
    <h2 class='title'><data:title/></h2> 
  </b:if> 
  <div class='widget-content'> 
    <data:content/> 
  </div> 
<b:include name='quickedit'/> 
</b:includable> 
</b:widget>

3. Choose the appropriate conditional tag

I listed some conditional tags in another post -Targeting specific pages with conditional tag. Copy your desired tag from there and apply it here.

4. Apply the tag

Paste the tag (from step 3) immediately after <b:includable id='main'> and the code line 11 to 15 immediately before </b:includable>, as shown below.

<b:widget id='WidgetID' locked='false' title='Widget title' type='HTML'>
<b:includable id='main'> 
PUT CONDITIONAL TAG HERE  
  <b:if cond='data:title != &quot;&quot;'> 
    <h2 class='title'><data:title/></h2> 
  </b:if> 
  <div class='widget-content'> 
    <data:content/> 
  </div> 
<b:include name='quickedit'/> 
<b:else/>
<style type='text/css'>
#WidgetID {display:none;}/*to hide empty widget box*/
</style>
</b:if> 
</b:includable> 
</b:widget>
 
Replace WidgetID in line 13 with the widget ID from code line 1.
The code will check whether the condition is true or false:
  • If the result is true, it executes (and display) the widget’s content.
  • If the result is false, it skips the content and hide the widget.
    You need to hide the widget because in most templates the content-less widget will still appear -as an empty box.

5. Save and view

Click Save Template button and view your blog.

That’s all to it. Enjoy!

original post in bloggersentral.com
How to Add meta descriptions to Blogger

A better way to add meta tags to Blogger

One way to improve your blog SEO (Search Engine Optimization) is to add in description and keywords meta tags. They are placed inside the head section of your blog template HTML.
In description meta tag you put a description of your blog, telling what your blog is about. In keyword meta tag you put in key words relevant to your blog content.

Duplicate meta descriptions

There is a problem though, in Blogger (blogspot) the meta tags will not only reside in your homepage but also in every post pages that you create (when you post an article). Let say you posted 100 articles so far, then all 100 pages (+1 for the home page) will share the same meta tags!. This is not good, for two reasons:
  1. Google uses your meta description (if you have one installed) as content snippet in Google SERP (search engine results page). Imagine you have same snippet for all your pages!
  2. Google will regard them as duplicate contents (duplicate meta descriptions).  Google Webmaster Tools will issue a warning if you have duplicate descriptions.

The solution

Update Mar 2012: You can now natively add meta description to individual posts/pages on Blogger.
There are two ways to prevent duplicate meta descriptions:
  1. Create one set of meta tags for each page and apply them to their respective page using blog URL conditional tags. Can be done, but impractical -imagine adding 100 sets of meta and conditional tags in your template!
  2. Limit meta description tag to homepage only. I choose this method, the easy way! (When there is no meta description exists in a (post) page, Google will use an excerpt from the post content as search result content snippet).

    Adding the meta tags, the better way

    So I’m going to explain method no.2, here it is:
    1. First go to Dashboard > Design > Edit HTML and find this line in your blog template HTML codes:
      <b:include data='blog' name='all-head-content'/>
    2. Then put the meta tags code immediately below that line. The final result should be as shown below.
      <b:include data='blog' name='all-head-content'/>
      <meta content='PUT KEYWORDS HERE SEPARATED BY COMMAS' name='keywords'/>
      <b:if cond='data:blog.pageType == &quot;index&quot;'>
      <meta content='PUT BLOG DESCRIPTION HERE' name='description'/>
      </b:if>
      What this code does is apply the keyword meta tag to all pages and limit description meta tag to only your homepage.
    3. Save the template.

      Checking the meta tags

      Confirm whether you’ve entered the meta tags correctly, using an online meta tag checker.
      • Make sure you check at least two pages -home page and one of the post pages.
      • Compare the extracted meta information, notice the difference.
      Enjoy!
      From bloggersentral.com
      A better way to add meta tags to Blogger