Technical Blog

Backlinks on Main Page

Posted on

This hack has been superceded by this better one.

Getting Blogger baclinks to display on your main page is no picnic – wheather for peek-a-boo or permanent display. The way the script works direct from Blogger it assumes that it is running on a post page. So, after mor than a little fussing, I have come up with a hack that works for fixing this. The following will install peek-a-boo backlinks on your Blogger blog (template hackers will be pleased to know that the backlink template-tag section is still intact for your hacking pleasure) :

  1. Enable backlinks on your blog — an obvious, but necessary, step
  2. a – Put manual metadata in your template. Feedburner users have already done this. If you already have your metadata in your template manually for this or another reason, change this line:
    <script type="text/javascript" src=""></script>

    To this:

    <script type="text/javascript" src=""></script>

    Otherwise go on to 2b.

    b – Find this : ‘<$BlogMetaData$>‘, it should be somewhere near the top of your blog template. Replace it with this:

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="MSSmartTagsPreventParsing" content="true" />
    <meta name="generator" content="Blogger" />
    <link rel="alternate" type="application/xml" title="<$BlogTitle$>" href="<$BlogSiteFeedUrl$>" />
    <link rel="" type="application/atom+xml" title="<$BlogTitle$>" href=";$BlogID$>" />
    <link rel="EditURI" type="application/rsd+xml" title="RSD" href=";$BlogID$>" />
    <style type="text/css">
     @import url("");
     @import url(";$BlogID$>");
    <script type="text/javascript" src=""></script>
    <script type="text/javascript" src=""></script>
    <script type="text/javascript">var BL_backlinkURL='', BL_blogId='<$BlogID$>';</script>
  3. Put this code directly after that which you just inserted:
    <script type="text/javascript">
    function toggleitem (postid,linkid,newtxt) {
    var whichpost = document.getElementById(postid);
    if ( != "none") { = "none";
    } else { = "block";
    if(linkid) {
       var lnk = document.getElementById(linkid);
       lnk.href = "javascript:toggleitem('"+postid+"','"+linkid+"','"+lnk.innerHTML+"');";
    lnk.innerHTML = newtxt;
  4. Find the section in your template that starts with ‘<BlogItemBacklinksEnabled>‘ and ends with ‘</BlogItemBacklinksEnabled>‘ and replace the entire thing (these tags included) with this code:
    <ItemPage><div style="display:block;" id="backlinks<$BlogItemNumber$>"></ItemPage>
    <MainOrArchivePage><div style="display:none;" id="bl<$BlogItemNumber$>"></MainOrArchivePage>
     <a name="links"></a><h4>Backlinks:</h4>
     <dl id="comments-block">
    <script type="text/javascript">backlink = new Array();BL_Backlinks = new Array();</script>
    <script type="text/javascript" src=";$BlogID$>&amp;postID=<$BlogItemNumber$>" defer="true"></script>
    <div id="blogger-dcom-block<$BlogItemNumber<div id="blogger-dcom-block<$BlogItemNumber<div id="blogger-dcom-block<$BlogItemNumber<div id="blogger-dcom-block<$BlogItemNumber<div id="blogger-dcom-block<$BlogItemNumber<div id="blogger-dcom-block<$BlogItemNumber<div id="blogger-dcom-block<$BlogItemNumber<div id="blogger-dcom-block<$BlogItemNumber$>" style="display:none">
    amp;gt;" style="display:none">
    amp;gt;" style="display:none">
    amp;gt;" style="display:none">
         <dt class="comment-title">
         <span class="comment-toggler"> </span>
         <a href="<$BlogBacklinkURL$>"><$BlogBacklinkTitle$></a>
         <dd class="comment-body"><$BlogBacklinkSnippet$>
         <br />
         <span class="comment-poster">
         <em>posted by <$BlogBacklinkAuthor$> @ <$BlogBacklinkDateTime$></em>
    <script type="text/javascript">BL_writeBacklinks('<$BlogItemNumber$>');</script>
     <p class="comment-timestamp"><$BlogItemBacklinkCreate$></p>
  5. Find the code for the ‘links to this post’ link in your post footer template code and replace it with ‘<a href=”javascript:toggleitem(‘backlinks<$BlogItemNumber$>’);”>links to this post</a>
  6. Save your template and republish your blog!

14 Responses


Not the most straightforward, no. I wanted to leave the templtate tags mostly intact so that template hackers could still change the formatting. This was also a quick-fix version of this hack, I didn’t do much research beforehand. I think eventually I’ll make a much simpler, much smaller version that is XML-well-formed (this isn’t because of the raw template tags). It’ll be less customisable, but that’s not really the end of the world.


I love your site, I can’t find your email anywhere, Id love the code for the show/hide sidebar hack. It’s briliant. Can you please email me at, thanks so much!


So following this I should be able to have peek-a-boo backlinks on my blog? Does this interfere with the peek-a-boo comments as the ItemPage section was removed when following Blogger help steps.



So following this I should be able to have peek-a-boo backlinks on my blog? Does this interfere with the peek-a-boo comments as the ItemPage section was removed when following Blogger help steps.


home owner insurance online quote

” REL=”nofollow”>pharmacy tech online ” REL=”nofollow”>betting casino roulette ” REL=”nofollow”>online stock trading company ” REL=”nofollow”>parfum perfume ” REL=”nofollow”>no-fax payday loans

inguinal hernia repair

” REL=”nofollow”>small business home business webstore ” REL=”nofollow”>best home rate refinance ” REL=”nofollow”>indian horse racing ” REL=”nofollow”>free hydrocodone online prescription ” REL=”nofollow”>injury settlement lump sum

winter sonata piano score

” REL=”nofollow”>sports betting sports betting line ” REL=”nofollow”>detection and removal remove spyware free ” REL=”nofollow”>sign of stomach flu ” REL=”nofollow”>site tenuate ” REL=”nofollow”>thyroid stimulating hormone level

casino hotel las stardust vegas

” REL=”nofollow”>college counseling degree online school wasc ” REL=”nofollow”>125 casino gambling game online ” REL=”nofollow”>phentermine online pharmacy ” REL=”nofollow”>part roulette wheel ” REL=”nofollow”>tip for online stock trading

bank of america cash advance

” REL=”nofollow”>lawyer montana celebrex ” REL=”nofollow”>air airfare cheap flight lowest ” REL=”nofollow”>cheap discount discount free free plane ticket travel ” REL=”nofollow”>chin photo reduction surgery ” REL=”nofollow”>cipro dosage

neuroendocrine pancreas tumor

” REL=”nofollow”>de eau hilton parfum paris ” REL=”nofollow”>military payday loans ” REL=”nofollow”>short term personal loans ” REL=”nofollow”>phentermine site ” REL=”nofollow”>propecia tablet

filing bankruptcy in nassau

” REL=”nofollow”>bariatric lose memorial surgery ” REL=”nofollow”>hand held video poker and black jack games ” REL=”nofollow”>bontril side effects ” REL=”nofollow”>after augmentation before breast mail ” REL=”nofollow”>breast reconstruction after mastectomy

horny goat weed beauty

” REL=”nofollow”>hollywood horse park racing result ” REL=”nofollow”>hydrocodone international pharmacy ” REL=”nofollow”>knee injury settlement ” REL=”nofollow”>canadian canadian canadian canadian immigrant insurance insurance insurance medical travel travel travel ” REL=”nofollow”>foreclosure investing pre

Leave a Response