How To Make Blogger Label URL or Permalink Like Wordpress To Optimize Your Blog

How To Make Blogger Label URL or Permalink Like Wordpress To Optimize Your Blog

Updated on 12 August
Optimize your blog labels by making them more SEO friendly as in WordPress. As you know everyone uses labels to label their posts to provide is to their visitors It's really a great thing to manage a large number of ports in a single block by arranging them in a category.
When you create a label in Blogger name like "Blogger Tips", you'll get this label link it looks like this:
https://a4f.blogspot.com/search/label/Blogger%20Tips
So above URL is quite difficult to recognize label name, instead of using it like this we'll use dashes rather than using spaces between labels and use small alphabets then it looks like this
https://a4f.blogspot.com/search/label/blogger-tips

How To Make Blogger Label URL or Permalink Like Wordpress To Optimise Your Blog

Step 1

When creating new post, add label look like blogger-tips, so label URL: https://a4f.blogspot.com/search/label/blogger-tips

Step 2

Now we need to display label name on blog as Blogger Tips, there are 2 ways:

- Using javascript

Add following script before </body>:
<script type='text/javascript'>
//<![CDATA[
var tnreplace = function(labelreplace) {
    return labelreplace.replace(/([\/-])?label-name-1/gi, function($0,$1){ return $1?$0:'Label Name 1';});
    } 
    var mytitle = document.title ; 
    document.title = tnreplace(mytitle)
    var mybody=document.body.innerHTML;
    document.body.innerHTML= tnreplace(mybody);
//]]>
</script>
Change highlight text by label name on your Blog.
If you want to use this for multi labels, add code .replace(/([\/-])?label-name-2/gi, function($0,$1){ return $1?$0:'Label Name 2';}) after return labelreplace

- Using xml code

  1. Add following code after <b:defaultmarkup type='Common'>:
    <b:includable id='maxbong_optimized_label' var='post'>
      <b:if cond='data:label.name == &quot;label-name-1&quot;'>
     Label Name 1
      <b:elseif cond='data:label.name == &quot;label-name-2&quot;'/>
     Label Name 2
      <b:else/>
       <data:label.name/>
      </b:if>
    </b:includable>
    
    <b:includable id='maxbong_optimized_pageName' var='post'>
      <b:if cond='data:blog.pageName == &quot;label-name-1&quot;'>
     Label Name 1
      <b:elseif cond='data:blog.pageName == &quot;label-name-2&quot;'/>
     Label Name 2
      <b:else/>
     <data:blog.pageName/>
      </b:if>
    </b:includable>
    
  2. Find and replace <data:label.name/> by <b:include name='maxbong_optimized_label'/>.
  3. Find and replace <data:blog.pageName/> which are after tag <body> by <b:include name='maxbong_optimized_pageName'/>.
  4. Find and replace <data:blog.pageName/> which are before tag </head> by:
    <b:if cond='data:blog.pageName == &quot;label-name-1&quot;'>
     Label Name 1
    <b:elseif cond='data:blog.pageName == &quot;label-name-2&quot;'/>
     Label Name 2
    <b:else/>
     <data:blog.pageName/>
    </b:if>
    

0 comments for How To Make Blogger Label URL or Permalink Like Wordpress To Optimize Your Blog

Cancel