• A JavaScript that
Kills Google AutoLink Links |
Remember Microsoft smart tags?
Well Google has added a new feature to the toolbar, the AutoLink
feature.
What's the AutoLink feature you say? The Google Autolink feature
is fairly self descriptive. Lets say you have a street address on
your site; Google will add a link to that street address on
Google maps. It can change a Fedex or UPS tracking
number into a link to Fedex or UPS. It can make an ISBN number
link to Amazon, and the list goes on!! In fact the list is
only as short as Google wishes. There are many concerns from all
of the privacy issues to the subjectivity of what should be
allowed to link, and where it links to according to Google
executives. It seems to have made a large noise in the internet
community.
However, another big issue is involved here beyond all the
commotion. Google is taking the liberty to change the content of
your pages. What do I mean? Well, the whole idea of Google
AutoLinks is to create hyperlinks in YOUR content to external
sources. What if you own a bookstore and what to list the
ISBN number? Do you want your customers with the Google
Autolink feature turned on (their choice not yours) have your
books link to Amazon (or whatever storefront Google
decides). I don't think so.
How can I stop the madness you say?
Well its simple. I have found a script by Chris at Search
Guild that webmasters can insert into their webpages
that kills Google AutoLink links.
What you need to do:
- Insert the script anywhere in your html (remember the
<Script> tags)
- or link it using the <script> tag in the <head>
of your pages
The code will rewrite the rewritten URLs. Killing the Autolink
functionality.
Here is the code:
// AutoBlink
// Puts Google's Autolink on the Blink :)
// (c) 2005 Chris Ridings http://www.searchguild.com
// Redistribute at will but leave this message intact
var linkcount;
function countlinks() {
var numlinks;
numlinks=0;
for (i=0; i < document.links.length; i++) {
numlinks++;
}
return numlinks;
}
function checklinks() {
if (!(linkcount==countlinks())) {
// Something changed the links!
// Iterate for an id of _goog
found=0;
for (i=0; i < document.links.length;
i++) {
if (document.linksi.id.substring(0,5)=="_goog")
{
// If we find
an id of _goog then remove the link!
var tr =
document.linksi.parentTextEdit.createTextRange();
tr.moveToElementText(document.linksi);
tr.execCommand("Unlink",false);
tr.execCommand("Unselect",false);
}
}
}
setTimeout("checklinks()",500);
}
if (document.getElementById &&
document.createElement) {
linkcount=countlinks();
setTimeout("checklinks()",500);
} |
I am sure you will find it very useful.
|