-->

How to Optimize SEO with Increasing Code To Text Ratio of your Blogger Website

Today I am sharing an article about SEO Optimization on Google Blogger Blog. Blogger Blog is the best source to run a website or blog with simple ways. If you are using default blogger template, then it is good because code to text ratio on these templates are good but if you have a third party blogger template, your code to text ratio may be poor which is not good because your blog or website may be marked as spam by search engines.

Replace Post Summary with Snippet to Increase Code to Text Ratio


What is Code to Text Ratio:

Code to text ratio is the percentage of text on your page and a comparison of code with the readable text. Google loves these websites which are for humans; it means website with low code and more text. Code to text ration is the important part of SEO. If your third party template is not optimized let's optimized it for batter ranking.

Code To Text Ratio Boosting Tip for Batter Blogger SEO:

Important: Please take the backup of your blogger template before modifications

  1. Login to Blogger
  2. Goto Template > Edit HTML
  3. Press CTRL+F and Search for Code </head>
  4. Paste the following Code Just above </head>
<script type='text/javascript'>//<![CDATA[function rp(json){document.write('<ul>');for(var i=0;i<numposts;i++){document.write('<li>');var entry=json.feed.entry[i];var posttitle=entry.title.$t;var posturl;if(i==json.feed.entry.length)break;for(var k=0;k<entry.link.length;k++){if(entry.link[k].rel=='alternate'){posturl=entry.link[k].href;break}}posttitle=posttitle.link(posturl);var readmorelink="(more)";readmorelink=readmorelink.link(posturl);var postdate=entry.published.$t;var cdyear=postdate.substring(0,4);var cdmonth=postdate.substring(5,7);var cdday=postdate.substring(8,10);var monthnames=new Array();monthnames[1]="Jan";monthnames[2]="Feb";monthnames[3]="Mar";monthnames[4]="Apr";monthnames[5]="May";monthnames[6]="Jun";monthnames[7]="Jul";monthnames[8]="Aug";monthnames[9]="Sep";monthnames[10]="Oct";monthnames[11]="Nov";monthnames[12]="Dec";if("content"in entry){var postcontent=entry.content.$t}else if("summary"in entry){var postcontent=entry.summary.$t}else var postcontent="";var re=/<\S[^>]*>/g;postcontent=postcontent.replace(re,"");document.write(posttitle);if(showpostdate==true)document.write(' - '+monthnames[parseInt(cdmonth,10)]+' '+cdday);if(showpostsummary==true){if(postcontent.length<numchars){document.write(postcontent)}else{postcontent=postcontent.substring(0,numchars);var quoteEnd=postcontent.lastIndexOf(" ");postcontent=postcontent.substring(0,quoteEnd);document.write(postcontent+'...'+readmorelink)}}document.write('</li>')}document.write('</ul>')}
//]]></script>
<script type='text/javascript'>summary_noimg = 600;
</script><script type='text/javascript'>//<![CDATA[
function removeHtmlTag(strx,chop){ if(strx.indexOf("<")!=-1) { var s = strx.split("<"); for(var i=0;i<s.length;i++){ if(s[i].indexOf(">")!=-1){ s[i] = s[i].substring(s[i].indexOf(">")+1,s[i].length); } } strx = s.join(""); } chop = (chop < strx.length-1) ? chop : strx.length-2; while(strx.charAt(chop-1)!=' ' && strx.indexOf(' ',chop)!=-1) chop++; strx = strx.substring(0,chop-1); return strx+'...';}
function createSummaryAndThumb(pID){ var div = document.getElementById(pID); var imgtag = ""; var img = div.getElementsByTagName("img"); var summ = summary_noimg; var summary = imgtag + '<div>' + removeHtmlTag(div.innerHTML,summ) + '</div>'; div.innerHTML = summary;}
//]]></script>

  • Now Search again for:<div class='post-header-line-1'/>
  • You template may have 2 codes of like this so choose the second code:
  • Here you may find the code like below: <p><data:post.snippet/></p> replace this code with following

<div expr:id='&quot;summary&quot; + data:post.id'><data:post.body/></div><script type='text/javascript'>createSummaryAndThumb(&quot;summary<data:post.id/>&quot;);</script>

That's all, If you have any issue with this code or something else, please ask me i am here for your help: Thank you for reading. Happy Blogging!